|
1 | 1 | --- |
2 | 2 | name: tox |
3 | 3 |
|
4 | | -# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency |
5 | | -concurrency: |
6 | | - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
7 | | - cancel-in-progress: true |
8 | | - |
9 | 4 | on: |
10 | | - push: # only publishes pushes to the main branch to TestPyPI |
11 | | - branches: # any integration branch but not tag |
| 5 | + merge_group: |
| 6 | + branches: |
| 7 | + - "main" |
| 8 | + push: |
| 9 | + branches: |
12 | 10 | - "main" |
13 | 11 | pull_request: |
| 12 | + branches: |
| 13 | + - "main" |
| 14 | + schedule: |
| 15 | + - cron: "0 0 * * *" |
| 16 | + workflow_call: |
14 | 17 |
|
15 | | -jobs: |
16 | | - pre: |
17 | | - name: pre |
18 | | - runs-on: ubuntu-24.04 |
19 | | - outputs: |
20 | | - matrix: ${{ steps.generate_matrix.outputs.matrix }} |
21 | | - steps: |
22 | | - - name: Determine matrix |
23 | | - id: generate_matrix |
24 | | - uses: coactions/dynamic-matrix@v1 |
25 | | - with: |
26 | | - min_python: "3.10" |
27 | | - max_python: "3.13" |
28 | | - default_python: "3.13" # used by jobs in other_names |
29 | | - other_names: | |
30 | | - lint |
31 | | - pkg |
32 | | - devel |
33 | | - build: |
34 | | - name: ${{ matrix.name }} |
35 | | - runs-on: ubuntu-24.04 |
36 | | - needs: pre |
37 | | - env: |
38 | | - PYTEST_REQPASS: 14 |
39 | | - strategy: |
40 | | - fail-fast: false |
41 | | - matrix: ${{ fromJson(needs.pre.outputs.matrix) }} |
42 | | - |
43 | | - steps: |
44 | | - - name: Checkout repository |
45 | | - uses: actions/checkout@v4 |
46 | | - with: |
47 | | - fetch-depth: 0 # needed by setuptools-scm |
48 | | - |
49 | | - - name: Install Python |
50 | | - uses: actions/setup-python@v5 |
51 | | - with: |
52 | | - python-version: ${{ matrix.python_version }} |
53 | | - |
54 | | - - name: Install dependencies |
55 | | - run: | |
56 | | - python -m pip install -U pip |
57 | | - pip install 'tox>=4.2.3' |
58 | | -
|
59 | | - - name: Run tox run -e ${{ matrix.passed_name }} |
60 | | - run: | |
61 | | - ${{ matrix.PREFIX }} tox run -e ${{ matrix.passed_name }} |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} |
| 20 | + cancel-in-progress: true |
62 | 21 |
|
63 | | - check: # This job does nothing and is only used for the branch protection |
64 | | - if: always() |
| 22 | +permissions: |
| 23 | + checks: read |
| 24 | + contents: read |
| 25 | + id-token: write |
| 26 | + packages: write |
| 27 | + pull-requests: write |
65 | 28 |
|
66 | | - needs: |
67 | | - - build |
68 | | - runs-on: ubuntu-24.04 |
69 | | - steps: |
70 | | - - name: Decide whether the needed jobs succeeded or failed |
71 | | - uses: re-actors/alls-green@release/v1 |
72 | | - with: |
73 | | - jobs: ${{ toJSON(needs) }} |
| 29 | +jobs: |
| 30 | + tox: |
| 31 | + uses: ansible/team-devtools/.github/workflows/tox.yml@main |
| 32 | + with: |
| 33 | + min_python: "3.10" |
| 34 | + max_python: "3.13" |
| 35 | + default_python: "3.13" # used by jobs in other_names |
| 36 | + skip_explode: "1" |
| 37 | + other_names: | |
| 38 | + lint |
| 39 | + pkg |
| 40 | + devel |
| 41 | + py310 |
| 42 | + py311 |
| 43 | + py312 |
| 44 | + py313 |
0 commit comments