-
Notifications
You must be signed in to change notification settings - Fork 52
158 lines (152 loc) · 5.48 KB
/
python-wasm.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
name: Python Wasm
on: [push,pull_request]
env:
pyodide-version: 0.23.1
jobs:
test-itkwasm:
runs-on: ${{ matrix.os }}
env:
python-version: ${{ format('{0}.{1}', matrix.python-major-version, matrix.python-minor-version) }}
strategy:
max-parallel: 3
matrix:
os: [ubuntu-22.04, windows-2022, macos-12]
python-major-version: [3]
python-minor-version: [7, 8, 9, 10, 11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Install dependencies
working-directory: ./packages/core/python/itkwasm
shell: bash
run: |
python -m pip install --upgrade pip
cd test/test-accelerator
python -m pip install -e "."
cd -
python -m pip install -e "."
python -m pip install hatch itk pytest
- name: Test on native
if: ${{ matrix.python-minor-version < 10 }}
working-directory: ./packages/core/python/itkwasm
run: |
hatch build -t wheel
pytest --junitxml=junit/test-results-${{ env.python-version }}.xml
- name: Download Pyodide
if: ${{ matrix.python-minor-version > 9 }}
shell: bash
working-directory: ./packages/core/python/itkwasm
run: |
curl -L https://github.com/pyodide/pyodide/releases/download/${{ env.pyodide-version }}/pyodide-${{ env.pyodide-version }}.tar.bz2 -o pyodide.tar.bz2
tar xjf pyodide.tar.bz2
rm -rf dist
mv pyodide dist
- name: Install pytest-pyodide
if: ${{ matrix.python-minor-version > 9 }}
shell: bash
run: |
python -m pip install pytest-pyodide
- uses: thewtex/pyodide-actions/install-browser@chrome-install
if: ${{ matrix.python-minor-version > 9 }}
with:
runner: selenium
browser: chrome
browser-version: latest
- name: Test with chrome
if: ${{ matrix.python-minor-version > 9 }}
working-directory: ./packages/core/python/itkwasm
run: |
hatch build -t wheel
ls dist
pytest --junitxml=junit/test-results-${{ env.python-version }}.xml --dist-dir=./dist --rt=chrome
- name: Upload pytest test results
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: pytest-results-${{ env.python-version }}
path: 'packages/core/python/itkwasm/junit/test-results*.xml'
test-pythonpackages:
runs-on: ${{ matrix.os }}
env:
python-version: ${{ format('{0}.{1}', matrix.python-major-version, matrix.python-minor-version) }}
strategy:
max-parallel: 3
matrix:
os: [ubuntu-22.04, windows-2022, macos-12]
python-major-version: [3]
python-minor-version: [7, 8, 9, 10, 11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hatch pytest
- name: Install pytest-pyodide
if: ${{ matrix.python-minor-version > 9 }}
shell: bash
run: |
python -m pip install pytest-pyodide
- uses: thewtex/pyodide-actions/install-browser@chrome-install
if: ${{ matrix.python-minor-version > 9 }}
with:
runner: selenium
browser: chrome
browser-version: latest
- name: Test compress-stringify wasi native
if: ${{ matrix.python-minor-version < 10 }}
working-directory: ./packages/compress-stringify/python/itkwasm-compress-stringify-wasi
run: |
python -m pip install -e .
pytest
- name: Test compress-stringify-emscripten chrome
if: ${{ matrix.python-minor-version > 9 }}
working-directory: ./packages/compress-stringify/python/itkwasm-compress-stringify-emscripten
shell: bash
run: |
hatch run download-pyodide
hatch build -t wheel
ls dist
python -m pip install -e .
pytest --dist-dir=./dist --rt=chrome
- name: Test compress-stringify chrome
if: ${{ matrix.python-minor-version > 9 }}
working-directory: ./packages/compress-stringify/python/itkwasm-compress-stringify
shell: bash
run: |
hatch run download-pyodide
hatch build -t wheel
ls dist
python -m pip install -e .
pytest --dist-dir=./dist --rt=chrome
- uses: actions/setup-node@v3
with:
node-version: '18.16'
- name: Download test data
shell: bash
run: |
npm ci
npm run build:testData
- name: Test dicom wasi native
if: ${{ matrix.python-minor-version < 10 }}
working-directory: ./packages/dicom/python/itkwasm-dicom-wasi
run: |
python -m pip install pillow
python -m pip install -e .
pytest
- name: Test dicom-emscripten chrome
if: ${{ matrix.python-minor-version > 9 }}
working-directory: ./packages/dicom/python/itkwasm-dicom-emscripten
shell: bash
run: |
hatch run download-pyodide
hatch build -t wheel
ls dist
python -m pip install -e .
pytest --dist-dir=./dist --rt=chrome