| 1 |
name: build |
| 2 |
on: [push, pull_request, workflow_dispatch] |
| 3 |
jobs: |
| 4 |
test: |
| 5 |
name: {{ '${{ matrix.name }}' }} |
| 6 |
runs-on: {{ '${{ matrix.os }}' }} |
| 7 |
timeout-minutes: 30 |
| 8 |
strategy: |
| 9 |
fail-fast: false |
| 10 |
matrix: |
| 11 |
include: |
| 12 |
- name: 'check' |
| 13 |
python: '3.13' |
| 14 |
tox_env: 'check' |
| 15 |
os: 'ubuntu-latest' |
| 16 |
- name: 'docs' |
| 17 |
python: '3.13' |
| 18 |
tox_env: 'docs' |
| 19 |
os: 'ubuntu-latest' |
| 20 |
{% for env in tox_environments %} |
| 21 |
{% set prefix = env.split('-')[0] -%} |
| 22 |
{% set freethreaded = prefix.endswith('t') %} |
| 23 |
{% if prefix.startswith('pypy') %} |
| 24 |
{% set python %}pypy-{{ prefix[4] }}.{{ prefix[5:] }}{% endset %} |
| 25 |
{% set cpython %}pp{{ prefix[4:5] }}{% endset %} |
| 26 |
{% else %} |
| 27 |
{% set python %}{{ prefix[2] }}.{{ prefix[3:].rstrip('t') }}{% endset %} |
| 28 |
{% set cpython %}cp{{ prefix[2:] }}{% endset %} |
| 29 |
{% endif %} |
| 30 |
{% for os, python_arch in [ |
| 31 |
['ubuntu', 'x64'], |
| 32 |
['windows', 'x64'], |
| 33 |
['macos', 'arm64'], |
| 34 |
] %} |
| 35 |
- name: '{{ env }} ({{ os }}/{{ python_arch }})' |
| 36 |
python: '{{ python }}' |
| 37 |
python_arch: '{{ python_arch }}' |
| 38 |
tox_env: '{{ env }}' |
| 39 |
os: '{{ os }}-latest' |
| 40 |
{% if 'cover' in env %} |
| 41 |
cover: true |
| 42 |
{% endif %} |
| 43 |
{% endfor %} |
| 44 |
{% endfor %} |
| 45 |
steps: |
| 46 |
- uses: actions/checkout@v5 |
| 47 |
with: |
| 48 |
fetch-depth: 0 |
| 49 |
- uses: actions/setup-python@v5 |
| 50 |
with: |
| 51 |
python-version: {{ '${{ matrix.python }}' }} |
| 52 |
architecture: {{ '${{ matrix.python_arch }}' }} |
| 53 |
- name: install dependencies |
| 54 |
run: | |
| 55 |
python -mpip install --progress-bar=off -r ci/requirements.txt |
| 56 |
virtualenv --version |
| 57 |
pip --version |
| 58 |
tox --version |
| 59 |
pip list --format=freeze |
| 60 |
- name: test |
| 61 |
run: > |
| 62 |
tox -e {{ '${{ matrix.tox_env }}' }} -v |
| 63 |
- uses: coverallsapp/github-action@v2 |
| 64 |
if: matrix.cover |
| 65 |
continue-on-error: true |
| 66 |
with: |
| 67 |
flag-name: {{ '${{ matrix.name }}' }} |
| 68 |
parallel: true |
| 69 |
- uses: codecov/codecov-action@v5 |
| 70 |
if: matrix.cover |
| 71 |
with: |
| 72 |
flags: {{ '${{ matrix.name }}' }} |
| 73 |
token: {{ '${{ secrets.CODECOV_TOKEN }}' }} |
| 74 |
verbose: true |
| 75 |
finish: |
| 76 |
needs: test |
| 77 |
if: {{ '${{ always() }}' }} |
| 78 |
runs-on: ubuntu-latest |
| 79 |
steps: |
| 80 |
- uses: coverallsapp/github-action@v2 |
| 81 |
with: |
| 82 |
parallel-finished: true |
| 83 |
{{- '' }} |