-
Notifications
You must be signed in to change notification settings - Fork 8
91 lines (82 loc) · 2.7 KB
/
test.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
name: test
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
pytest:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: cpython_setup
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: pytest (linux/macos)
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
run: |
python -m venv .venv
source .venv/bin/activate
echo "VIRTUAL_ENV: $VIRTUAL_ENV"
pip install --upgrade pip
pip install '.[test]'
coverage run -m pytest -s -vv
coverage html
- name: pytest (windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
python -m venv .venv
.venv/Scripts/Activate.ps1
echo "VIRTUAL_ENV: $VIRTUAL_ENV"
python -m pip install --upgrade pip
pip install '.[test]'
coverage run -m pytest -s -vv
coverage html
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.os }}-${{ matrix.python-version }}
path: htmlcov
retention-days: 5
action:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: cpython_setup
with:
python-version: ${{ matrix.python-version }}
cache: pip
# Note: I'm using pip, for faster CI. But you can also uses pipx:
# Example:
# - run: pipx install creosote --python '${{ steps.cpython_setup.outputs.python-path }}'
- run: pip install --upgrade creosote
- name: run creosote (linux/macos)
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
run: |
python -m venv .venv
source .venv/bin/activate
echo "VIRTUAL_ENV: $VIRTUAL_ENV"
pip install --upgrade .
creosote --venv .venv --exclude-dep tomli
- name: run creosote (windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
python -m venv .venv
.venv/Scripts/Activate.ps1
Write-Host "VIRTUAL_ENV: $env:VIRTUAL_ENV"
pip install --upgrade .
creosote --venv .venv --exclude-dep tomli