-
Notifications
You must be signed in to change notification settings - Fork 52
100 lines (82 loc) · 2.5 KB
/
tests.yml
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
name: tests
on:
push:
branches: [ main ]
pull_request:
schedule:
# Run every Sunday
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
code-quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11 with uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.11
- name: Install dependencies
run: |
uv pip install -r dev-requirements.txt
- name: Lint package
run: |
make lint
tests:
name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
needs: code-quality
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} with uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv pip install -r dev-requirements.txt
- name: Test Package
run: |
make test
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
if: matrix.os == 'ubuntu-latest'
- name: Build distribution and test installation
shell: bash
run: |
make dist
if [[ ${{ matrix.os }} == "windows-latest" ]]; then
PYTHON_BIN=Scripts/python
else
PYTHON_BIN=bin/python
fi
echo "=== Testing wheel installation ==="
uv virtualenv .venv-whl
uv pip install dist/deon-*.whl --python=.venv-whl/$PYTHON_BIN
.venv-whl/$PYTHON_BIN -m deon --help
echo "=== Testing source installation ==="
uv virtualenv .venv-sdist
uv pip install dist/deon-*.tar.gz --python=.venv-sdist/$PYTHON_BIN
.venv-sdist/$PYTHON_BIN -m deon --help
- name: Test Building Docs
run: |
make examples
make docs
notify:
name: Notify failed build
needs: [code-quality, tests]
if: failure() && github.event.pull_request == null
runs-on: ubuntu-latest
steps:
- uses: jayqi/failed-build-issue-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}