Skip to content

Commit e079057

Browse files
committed
ci: Split core-nompi into basic and docker
1 parent 0d6bda8 commit e079057

1 file changed

Lines changed: 63 additions & 48 deletions

File tree

.github/workflows/pytest-core-nompi.yaml

Lines changed: 63 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
- main
1919

2020
jobs:
21-
pytest:
21+
test-nompi-basic:
2222
name: ${{ matrix.name }}-${{ matrix.set }}
2323
runs-on: "${{ matrix.os }}"
2424

@@ -33,16 +33,13 @@ jobs:
3333

3434
matrix:
3535
name: [
36-
pytest-ubuntu-py311-gcc11-cxxnoomp,
37-
pytest-ubuntu-py312-gcc12-cxxomp,
36+
pytest-osx-py312-clang-omp,
3837
pytest-ubuntu-py310-gcc14-omp,
38+
pytest-ubuntu-py310-gcc9-omp,
3939
pytest-ubuntu-py311-gcc10-noomp,
40+
pytest-ubuntu-py311-gcc11-cxxnoomp,
41+
pytest-ubuntu-py312-gcc12-cxxomp,
4042
pytest-ubuntu-py312-gcc13-omp,
41-
pytest-ubuntu-py310-gcc9-omp,
42-
pytest-osx-py312-clang-omp,
43-
pytest-docker-py310-gcc-omp,
44-
pytest-docker-py310-gcc-omp-arm64,
45-
pytest-docker-py310-icx-omp,
4643
pytest-ubuntu-py313-gcc14-omp
4744
]
4845
set: [base, adjoint]
@@ -97,27 +94,6 @@ jobs:
9794
language: "openmp"
9895
sympy: "1.12"
9996

100-
- name: pytest-docker-py310-gcc-omp
101-
python-version: '3.10'
102-
os: ubuntu-latest
103-
arch: "gcc"
104-
language: "openmp"
105-
sympy: "1.13"
106-
107-
- name: pytest-docker-py310-gcc-omp-arm64
108-
python-version: '3.10'
109-
os: ubuntu-24.04-arm
110-
arch: "gcc"
111-
language: "openmp"
112-
sympy: "1.13"
113-
114-
- name: pytest-docker-py310-icx-omp
115-
python-version: '3.10'
116-
os: ubuntu-latest
117-
arch: "icx"
118-
language: "openmp"
119-
sympy: "1.13"
120-
12197
- name: pytest-ubuntu-py313-gcc14-omp
12298
python-version: '3.13'
12399
os: ubuntu-24.04
@@ -136,25 +112,21 @@ jobs:
136112
set: adjoint
137113

138114
steps:
139-
# TODO: This workflow should really be split into 2 (Docker and non-Docker)
140115
- name: Checkout devito
141116
uses: actions/checkout@v6
142117

143-
# Bare metal (not Docker)
144118
- name: Set up Python ${{ matrix.python-version }}
145-
if: "!contains(matrix.name, 'docker')"
146119
uses: actions/setup-python@v6
147120
with:
148121
python-version: ${{ matrix.python-version }}
149122
allow-prereleases: true
150123

151124
- name: Install ${{ matrix.arch }} compiler
152-
if: "runner.os == 'linux' && !contains(matrix.name, 'docker') && matrix.arch !='custom' "
125+
if: "runner.os == 'linux' && matrix.arch !='custom' "
153126
run : |
154127
sudo apt-get install -y ${{ matrix.arch }}
155128
156129
- name: Set tests (reduced number for OSX)
157-
if: "!contains(matrix.name, 'docker')"
158130
run : |
159131
if [ "${{ runner.os }}" == 'macOS' ]; then
160132
brew install llvm libomp
@@ -163,7 +135,6 @@ jobs:
163135
id: set-tests
164136

165137
- name: Set pip flags for latest python (3.12)
166-
if: "!contains(matrix.name, 'docker')"
167138
run: |
168139
ver="${{ matrix.python-version }}"
169140
major=${ver%%.*}
@@ -173,7 +144,6 @@ jobs:
173144
fi
174145
175146
- name: Install dependencies
176-
if: "!contains(matrix.name, 'docker')"
177147
run: |
178148
python3 -m pip install ${{ env.PIPFLAGS }} --upgrade pip
179149
python3 -m pip install ${{ env.PIPFLAGS }} -e ".[tests,extras]"
@@ -184,14 +154,12 @@ jobs:
184154
run: python3 -m pip install ${{ env.PIPFLAGS }} numpy==1.26
185155

186156
- name: Check configuration
187-
if: "!contains(matrix.name, 'docker')"
188157
run: |
189158
python3 \
190159
-c "from devito import configuration; \
191160
print(''.join(['%s: %s \n' % (k, v) for (k, v) in configuration.items()]))"
192161
193162
- name: Test with pytest
194-
if: "!contains(matrix.name, 'docker')"
195163
run: |
196164
pytest \
197165
-k "${{ matrix.test-set }}" \
@@ -202,33 +170,81 @@ jobs:
202170
tests/
203171
204172
- name: Upload coverage to Codecov
205-
if: "!contains(matrix.name, 'docker')"
206173
uses: codecov/codecov-action@v5
207174
with:
208175
token: ${{ secrets.CODECOV_TOKEN }}
209176
name: ${{ matrix.name }}
210177

211-
# Docker
178+
test-nompi-docker:
179+
name: ${{ matrix.name }}-${{ matrix.set }}
180+
runs-on: "${{ matrix.os }}"
181+
182+
env:
183+
DEVITO_ARCH: "${{ matrix.arch }}"
184+
DEVITO_LANGUAGE: ${{ matrix.language }}
185+
OMP_NUM_THREADS: 2
186+
187+
strategy:
188+
# Prevent all build to stop if a single one fails
189+
fail-fast: false
190+
191+
matrix:
192+
name: [
193+
pytest-docker-py310-gcc-omp,
194+
pytest-docker-py310-gcc-omp-arm64,
195+
pytest-docker-py310-icx-omp,
196+
]
197+
set: [base, adjoint]
198+
199+
include:
200+
- name: pytest-docker-py310-gcc-omp
201+
python-version: '3.10'
202+
os: ubuntu-latest
203+
arch: "gcc"
204+
language: "openmp"
205+
sympy: "1.13"
206+
207+
- name: pytest-docker-py310-gcc-omp-arm64
208+
python-version: '3.10'
209+
os: ubuntu-24.04-arm
210+
arch: "gcc"
211+
language: "openmp"
212+
sympy: "1.13"
213+
214+
- name: pytest-docker-py310-icx-omp
215+
python-version: '3.10'
216+
os: ubuntu-latest
217+
arch: "icx"
218+
language: "openmp"
219+
sympy: "1.13"
220+
221+
- set: base
222+
test-set: 'not adjoint'
223+
224+
- set: adjoint
225+
test-set: 'adjoint'
226+
227+
steps:
228+
- name: Checkout devito
229+
uses: actions/checkout@v6
230+
212231
- id: build
213232
name: Build docker image
214-
if: contains(matrix.name, 'docker')
215233
uses: ./.github/actions/docker-build
216234
with:
217235
file: docker/Dockerfile.devito
218-
tag: devito_img
236+
tag: ${{ matrix.name }}
219237
base: devitocodes/bases:cpu-${{ matrix.arch }}
220238

221239
- name: Get the Docker image Python version
222-
if: "contains(matrix.name, 'docker')"
223240
uses: ./.github/actions/docker-run
224241
with:
225242
uid: ${{ steps.build.outputs.unique }}
226-
tag: devito_img
243+
tag: ${{ matrix.name }}
227244
command: >
228245
python3 --version | grep "Python " | cut -d' ' -f2 | cut -d'.' -f1,2 > dockerpythonversion.txt
229246
230247
- name: Check Docker image Python version
231-
if: "contains(matrix.name, 'docker')"
232248
run: |
233249
declared_pyver="${{ matrix.python-version }}"
234250
actual_pyver=$(cat dockerpythonversion.txt)
@@ -240,13 +256,12 @@ jobs:
240256
fi
241257
242258
- name: Test with pytest
243-
if: "contains(matrix.name, 'docker')"
244259
uses: ./.github/actions/docker-run
245260
with:
246261
uid: ${{ steps.build.outputs.unique }}
262+
tag: ${{ matrix.name }}
247263
env: |
248264
CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}
249-
tag: devito_img
250265
command: |
251266
pytest \
252267
-k "${{ matrix.test-set }}" \
@@ -261,4 +276,4 @@ jobs:
261276
uses: ./.github/actions/docker-clean
262277
with:
263278
uid: ${{ steps.build.outputs.unique }}
264-
tag: devito_img
279+
tag: ${{ matrix.name }}

0 commit comments

Comments
 (0)