Debian Codegraph @

.github/workflows/main.yml

raw symbols SCIP
1 name: tests
2
3 on:
4 merge_group:
5 push:
6 branches-ignore:
7 # temporary GH branches relating to merge queues (jaraco/skeleton#93)
8 - gh-readonly-queue/**
9 tags:
10 # required if branches-ignore is supplied (jaraco/skeleton#103)
11 - '**'
12 pull_request:
13 workflow_dispatch:
14
15 permissions:
16 contents: read
17
18 env:
19 # Environment variable to support color support (jaraco/skeleton#66)
20 FORCE_COLOR: 1
21
22 # Suppress noisy pip warnings
23 PIP_DISABLE_PIP_VERSION_CHECK: 'true'
24 PIP_NO_WARN_SCRIPT_LOCATION: 'true'
25
26 # Ensure tests can sense settings about the environment
27 TOX_OVERRIDE: >-
28 testenv.pass_env+=GITHUB_*,FORCE_COLOR
29
30
31 jobs:
32 test:
33 strategy:
34 # https://blog.jaraco.com/efficient-use-of-ci-resources/
35 matrix:
36 python:
37 - "3.9"
38 - "3.13"
39 platform:
40 - ubuntu-latest
41 - macos-latest
42 - windows-latest
43 include:
44 - python: "3.10"
45 platform: ubuntu-latest
46 - python: "3.11"
47 platform: ubuntu-latest
48 - python: "3.12"
49 platform: ubuntu-latest
50 - python: "3.14"
51 platform: ubuntu-latest
52 - python: pypy3.10
53 platform: ubuntu-latest
54 runs-on: ${{ matrix.platform }}
55 continue-on-error: ${{ matrix.python == '3.14' }}
56 steps:
57 - uses: actions/checkout@v4
58 - name: Install build dependencies
59 # Install dependencies for building packages on pre-release Pythons
60 # jaraco/skeleton#161
61 if: matrix.python == '3.14' && matrix.platform == 'ubuntu-latest'
62 run: |
63 sudo apt update
64 sudo apt install -y libxml2-dev libxslt-dev
65 - name: Setup Python
66 uses: actions/setup-python@v5
67 with:
68 python-version: ${{ matrix.python }}
69 allow-prereleases: true
70 - name: Install tox
71 run: python -m pip install tox
72 - name: Run
73 run: tox
74
75 collateral:
76 strategy:
77 fail-fast: false
78 matrix:
79 job:
80 - diffcov
81 - docs
82 runs-on: ubuntu-latest
83 steps:
84 - uses: actions/checkout@v4
85 with:
86 fetch-depth: 0
87 - name: Setup Python
88 uses: actions/setup-python@v5
89 with:
90 python-version: 3.x
91 - name: Install tox
92 run: python -m pip install tox
93 - name: Eval ${{ matrix.job }}
94 run: tox -e ${{ matrix.job }}
95
96 check: # This job does nothing and is only used for the branch protection
97 if: always()
98
99 needs:
100 - test
101 - collateral
102
103 runs-on: ubuntu-latest
104
105 steps:
106 - name: Decide whether the needed jobs succeeded or failed
107 uses: re-actors/alls-green@release/v1
108 with:
109 jobs: ${{ toJSON(needs) }}
110
111 release:
112 permissions:
113 contents: write
114 needs:
115 - check
116 if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
117 runs-on: ubuntu-latest
118
119 steps:
120 - uses: actions/checkout@v4
121 - name: Setup Python
122 uses: actions/setup-python@v5
123 with:
124 python-version: 3.x
125 - name: Install tox
126 run: python -m pip install tox
127 - name: Run
128 run: tox -e release
129 env:
130 TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
131 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}