-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (69 loc) · 3.04 KB
/
Copy pathpytest.yml
File metadata and controls
81 lines (69 loc) · 3.04 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
name: Test package
on:
push:
branches: [main, develop]
workflow_dispatch: # Allows to run workflow manually from the Actions tab
schedule:
# Saunch workflow at 5:19 AM everyday
- cron: '19 5 * * *'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install project dependencies
run: |
python -m pip install --upgrade pip
pip install flit
flit install
- name: Windows - create test results and baseline directories
if: ${{ matrix.os == 'windows-latest'}}
run: |
New-Item -Path tests/pytest_mpl_results_${{ matrix.os }}_${{ matrix.python }} -ItemType Directory -Force
New-Item -Path tests/pytest_mpl_baseline_${{ matrix.os }}_${{ matrix.python }} -ItemType Directory -Force
New-Item -Path tests/mpl_new_baseline_${{ matrix.os }}_${{ matrix.python }} -ItemType Directory -Force
- name: Non windows - create test results and baseline directories
if: ${{ matrix.os != 'windows-latest'}}
run: |
mkdir -p tests/pytest_mpl_results_${{ matrix.os }}_${{ matrix.python }}
mkdir -p tests/pytest_mpl_baseline_${{ matrix.os }}_${{ matrix.python }}
mkdir -p tests/pytest_mpl_new_baseline_${{ matrix.os }}_${{ matrix.python }}
- name: Test with pytest
run: >
pytest
--mpl-results-path=tests/pytest_mpl_results_${{ matrix.os }}_${{ matrix.python }}
--mpl-baseline-path=tests/pytest_mpl_baseline_${{ matrix.os }}_${{ matrix.python }}
--mpl-generate-summary=html
- name: Generate new image baseline
if: failure()
run: >
pytest
--mpl-generate-path=tests/pytest_mpl_new_baseline_${{ matrix.os }}_${{ matrix.python }}
--last-failed
# always attempt to upload artifacts, even(and especially) in case of failure.
- name: Upload pytest-mpl report
if: always()
uses: actions/upload-artifact@v4
with:
name: pytest_mpl_results_${{ matrix.os }}_${{ matrix.python }}
path: tests/pytest_mpl_results_${{ matrix.os }}_${{ matrix.python }}/*
- name: Upload pytest-mpl new baseline
if: always()
uses: actions/upload-artifact@v4
with:
name: pytest_mpl_new_baseline_${{ matrix.os }}_${{ matrix.python }}
path: tests/pytest_mpl_new_baseline_${{ matrix.os }}_${{ matrix.python }}/*
if-no-files-found: ignore
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}