-
Notifications
You must be signed in to change notification settings - Fork 17
112 lines (105 loc) · 3.2 KB
/
test.yml
File metadata and controls
112 lines (105 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
name: test
on:
merge_group:
branches:
- main
push:
branches: # any integration branch but not tag
- main
pull_request:
branches:
- main
release:
types: [published]
workflow_dispatch:
inputs:
publish:
description: "Publish a pre-release"
required: false
default: "false"
schedule:
- cron: "0 0 * * *"
permissions:
contents: write
id-token: write
packages: write
pull-requests: write
checks: write
jobs:
lint:
runs-on: ubuntu-24.04
environment: ack # BOT_PAT
steps:
- name: Dump event information
run: |
echo "github.event_name: ${{ github.event_name }}"
echo "github.ref: ${{ github.ref }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.ref_type: ${{ github.ref_type }}"
echo "github.event.action: ${{ github.event.action }}"
echo "github.event.inputs: ${{ github.event.inputs }}"
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
token: ${{ secrets.BOT_PAT }}
- uses: astral-sh/setup-uv@v7
- uses: j178/prek-action@v2
id: prek
with:
extra-args: --config .pre-commit-config.yaml --all-files
continue-on-error: true
- name: Commit & push changes
id: commit-and-push
if: steps.prek.outcome == 'failure'
# git config push.default upstream
run: |
git config user.email "devtools@ansible.com"
git config user.name "Ansible Bot"
git add .
git status
git commit -m "chore[bot]: auto-fix lint errors"
git push
- name: react if linting errors were not fixed
if: steps.commit-and-push.outcome == 'failure'
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.actor }} I tried to fix the linting errors, but it didn't work. Please fix them manually.
See [CI log](https://github.com/${{ github.repository_owner }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.
test:
needs:
- lint
# tests reusable tox workflow
uses: ./.github/workflows/tox.yml
with:
default_python: "3.13"
max_python: "3.14"
min_python: "3.13"
run_post: echo 'Running post'
run_pre: echo 'Running pre'
other_names: |
docs
lint
py-mise-macos:tox -e py:runner=macos-15;mise=true
py-mise-ubuntu:tox -e py:runner=ubuntu-24.04;mise=true
py313-py314-macos:tox -e py313,py314:runner=macos-15
platforms: linux
node-version-file: .tool-versions
secrets: inherit
check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- test
runs-on: ubuntu-24.04
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
push:
if: github.event_name == 'push'
uses: ./.github/workflows/push.yml
secrets: inherit