-
Notifications
You must be signed in to change notification settings - Fork 10
183 lines (157 loc) · 5.02 KB
/
pytest.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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: pytest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
on:
push:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
# execute commands with conda aware shell by default:
defaults:
run:
shell: bash -l {0}
jobs:
event_file:
name: "Upload PR Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
main:
name: pytest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
py: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0' # Fetch all history for all tags and branches
- uses: marscher/pydeps2env@v999
with:
files: 'pyproject.toml'
channels: 'conda-forge defaults'
extras: 'test vis media'
build_system: 'include'
- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: "2.0.2-0"
environment-file: ./environment.yml
environment-name: weldx
init-shell: >-
bash
powershell
# persist on the same day.
cache-environment-key: environment-${{ steps.date.outputs.date }}
create-args: >-
python=${{ matrix.py }}
wheel
pip
- name: pip installs
run: |
python -m pip install -e .
- name: activate env
run: micromamba activate weldx
- name: install cookiecutter
if: matrix.py == '3.10'
run: |
pip install cookiecutter
- name: create installable quality standard from repo
if: matrix.py == '3.10'
run: |
cookiecutter --no-input https://github.com/BAMWeldx/quality-standard-template
- name: install quality standard
if: matrix.py == '3.10'
run: |
pip install -e ./quality_standard_demo
- name: run pytest
run: |
pytest -n 2 --runslow --junit-xml pytest.xml
- name: Upload Test Results
if: always() && (matrix.py == '3.10')
uses: actions/upload-artifact@v4
with:
name: Unit Test Results
path: pytest.xml
- name: run pytest on notebooks (append coverage)
if: matrix.py == '3.10'
run: |
pytest -n 2 --dist loadfile --nbval --current-env --cov-append ./doc/src/tutorials/
- name: test with WeldxFile
if: matrix.py == '3.10'
run: |
pytest -n 2 --weldx-file-rw-buffer --weldx-file-rw-buffer-disp-header --cov-append ./weldx/tests/asdf_tests
- name: test quality standard
if: matrix.py == '3.10'
run: |
pytest --cov-append ./weldx/tests/asdf_tests/quality_standards_check.py
- name: test installable quality standard from template repository
if: matrix.py == '3.10'
run: |
pytest --cov-append ./weldx/tests/asdf_tests/installable_quality_standard_check.py
- name: coverage xml (combination is performed by pytest-cov)
if: matrix.py == '3.10'
run: coverage xml
- name: codecov.io
if: matrix.py == '3.10'
uses: codecov/codecov-action@v4.6.0
compat:
name: pytest
if: |
(github.event.pull_request.draft == false) ||
(github.event_name == 'workflow_dispatch') ||
(github.ref == 'refs/heads/master')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
py: ['3.10']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0' # Fetch all history for all tags and branches
- uses: marscher/pydeps2env@v999
with:
files: 'pyproject.toml'
channels: 'conda-forge defaults'
extras: 'test vis media'
build_system: 'include'
- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./environment.yml
environment-name: weldx
init-shell: >-
bash
powershell
# persist on the same day.
cache-environment-key: environment-${{ steps.date.outputs.date }}
create-args: >-
python=${{ matrix.py }}
wheel
pip
- name: activate env
run: micromamba activate weldx
- name: pip installs
run: |
python -m pip install -e .
- name: setup matplotlib
if: startsWith(runner.os, 'Windows')
run: |
if not exist %userprofile%\.matplotlib\ ( mkdir %userprofile%\.matplotlib\ )
echo backend: Agg > %userprofile%\.matplotlib\matplotlibrc
shell: cmd
- name: run pytest
run: |
pytest -n 2 --runslow
echo "Exited with '$?'"