-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (115 loc) · 3.59 KB
/
Copy pathtest.yml
File metadata and controls
130 lines (115 loc) · 3.59 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build and test
on:
push:
branches:
- main
- maint/*
tags:
- "*"
pull_request:
branches:
- main
- maint/*
schedule:
- cron: '0 0 * * 1'
# Allow job to be triggered manually from GitHub interface
workflow_dispatch:
defaults:
run:
shell: bash
# Force tox and pytest to use color
env:
FORCE_COLOR: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build & verify package
runs-on: ubuntu-slim
permissions:
attestations: write
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: hynek/build-and-inspect-python-package@efb823f52190ad02594531168b7a2d5790e66516 # v2.14.0
with:
attest-build-provenance-github: ${{ github.event_name != 'pull_request' }}
tox:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version: ['3.14']
dependencies: ['latest', 'min']
env:
DEPENDS: ${{ matrix.dependencies }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@e06108dd0aef18192324c70427afc47652e63a82 # v7.5.0
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install tox
run: uv tool install -v tox --with=tox-uv-bare --with=tox-gh-actions
- name: Show tox config
run: tox c
- name: Setup test suite
run: tox run -vv --notest
- name: Run test suite
run: tox -v --skip-pkg-install --exit-and-dump-after 1200
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
if: ${{ always() }}
with:
files: cov.xml
token: ${{ secrets.CODECOV_TOKEN }}
checks:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-slim']
python-version: ['3.14']
check: ['typecheck']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup uv and Python
uses: astral-sh/setup-uv@e06108dd0aef18192324c70427afc47652e63a82 # v7.5.0
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install tox
run: uv tool install -v tox --with=tox-uv-bare --with=tox-gh-actions
- name: Show tox config (this call)
run: tox c -e ${{ matrix.check }}
- name: Setup check environment
run: tox -vv --notest -e ${{ matrix.check }}
- name: Run check
run: tox -e ${{ matrix.check }}
publish:
runs-on: ubuntu-latest
environment: "Package deployment"
needs: [build, tox]
permissions:
attestations: write
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0