Repository navigation
212 lines (169 loc) · 6 KB
/
Copy pathbuild-test.yml
File metadata and controls
212 lines (169 loc) · 6 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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Test build
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
# Required for miniconda to activate conda
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v6
- name: Get micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: test-env
init-shell: bash
create-args: >-
--strict-channel-priority
conda-forge/label/python_rc::_python_rc
python=${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v7
- name: Check active Python version
run: python -c "import sys; assert '.'.join(str(s) for s in sys.version_info[:2]) == '${{ matrix.python-version }}', f'{version} incorrect!'"
- name: Install ROOT
if: matrix.python-version == 3.9 && runner.os == 'Linux'
run: |
micromamba env list
micromamba install root
micromamba list
- name: Install sshd for fsspec ssh tests
if: runner.os == 'Linux'
run: |
sudo apt-get install -y openssh-server
sudo service ssh restart
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod og-wx ~/.ssh/authorized_keys
ssh-keyscan -H localhost >> ~/.ssh/known_hosts
ssh -o StrictHostKeyChecking=no localhost echo "ssh connection successful"
- name: Install XRootD
if: runner.os != 'Windows'
run: |
micromamba env list
micromamba install xrootd
micromamba list
- name: Pip install the package
run: uv pip install --system -e. --group=dev
- name: Run pytest
run: |
python -m pytest -vv tests --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"
vanilla-build:
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.13']
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@v7
- name: Pip install the package
run: uv pip install --system -e. --group=dev
- name: Run pytest
run: |
python -m pytest -vv tests --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"
numpy1-build:
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.11']
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v7
- name: Pip install the package
run: |
uv venv
uv pip install -e. 'numpy<2' --group test
- name: Run pytest
run: |
uv run --no-sync pytest -vv tests --reruns 10 --reruns-delay 30 --only-rerun "(?i)http|ssl|timeout|expired|connection|socket"
pyodide-build:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
PYODIDE_VERSION: 0.28.1
PYODIDE_BUILD_VERSION: 0.30.5
AWKWARD_VERSION: v2.8.5
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- uses: astral-sh/setup-uv@v7
- name: Install pyodide-build
run: python3 -m pip install pyodide-build==$PYODIDE_BUILD_VERSION
- name: Determine EMSDK version
id: compute-emsdk-version
run: |
pyodide config list
# Save EMSDK version
EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
echo "emsdk-version=$EMSCRIPTEN_VERSION" >> $GITHUB_OUTPUT
- name: Install EMSDK
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ steps.compute-emsdk-version.outputs.emsdk-version }}
- name: Build the package
run: pyodide build
- name: Build an awkward wheel compatible with the awkward-cpp version in pyodide
run: |
git clone --depth 1 --branch $AWKWARD_VERSION https://github.com/scikit-hep/awkward.git dependencies/awkward
pyodide build dependencies/awkward
rm -rf dependencies/
- name: Download Pyodide
uses: pyodide/pyodide-actions/download-pyodide@v2
with:
version: ${{ env.PYODIDE_VERSION }}
to: pyodide-dist
- name: Install browser
uses: pyodide/pyodide-actions/install-browser@v2
with:
runner: selenium
browser: chrome firefox
browser-version: latest
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: uv pip install --system -e. --group=test-pyodide pyodide-py==$PYODIDE_VERSION
- name: Run pytest (Chrome)
run: |
pytest -vv --dist-dir=./pyodide-dist/ --runner=selenium --runtime=chrome tests-wasm
- name: Run pytest (Firefox)
run: |
pytest -vv --dist-dir=./pyodide-dist/ --runner=selenium --runtime=firefox tests-wasm
pass:
if: always()
needs: [build, vanilla-build, numpy1-build, pyodide-build]
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}