-
Notifications
You must be signed in to change notification settings - Fork 261
90 lines (73 loc) · 2.22 KB
/
tests.yml
File metadata and controls
90 lines (73 loc) · 2.22 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
name: Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
- cron: "0 4 * * *"
permissions:
contents: read
env:
FORCE_COLOR: 1
jobs:
pytest:
name: Unit tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
- name: Install tox
run: uv tool install --python ${{ matrix.python }} --with tox-uv tox
- name: Add local bin to path on Windows
if: runner.os == 'Windows'
run: echo "C:/Users/runneradmin/.local/bin" >> $GITHUB_PATH
shell: bash
- name: Setup test suite
run: tox run -v --notest --skip-missing-interpreters false -e ${{ matrix.python }}
# Run all tests on schedule, but only non-slow tests on push.
# Use the coverage env on ubuntu/3.14 to generate coverage.xml for Codecov.
- name: Run pytest
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ] && [ "${{ matrix.python }}" == "3.14" ]; then
TOX_ENV=coverage
else
TOX_ENV=pytest
fi
if [ "${{ github.event_name }}" == "schedule" ]; then
tox -e $TOX_ENV
else
tox -e $TOX_ENV -- -m "not slow"
fi
shell: bash # this wouldn't work on Powershell
- name: Upload coverage reports to Codecov
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python == '3.14' }}
uses: codecov/codecov-action@v6.0.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
cli:
name: CLI smoke tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Test transforms CLI tool
run: uv run -- tiotr --help
- name: Test info CLI tool
run: uv run -- tiohd --help