Skip to content

Commit 4423e42

Browse files
committed
ci: Add Docker Python version checks
1 parent e0cd4f6 commit 4423e42

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ jobs:
166166
python3 -m pip install ${{ env.PIPFLAGS }} -e .[tests,extras]
167167
python3 -m pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}
168168
169+
- name: Check Docker image Python version
170+
if: "contains(matrix.name, 'docker')""
171+
run: |
172+
declared_pyver="${{ matrix.pyver }}"
173+
actual_pyver=$(${{ env.RUN_CMD }} python3 --version | cut -d' ' -f2 | cut -d'.' -f1,2)
174+
if [ "$declared_pyver" != "$actual_pyver" ]; then
175+
echo "Python version mismatch: declared $declared_pyver, image has $actual_pyver"
176+
exit 1
177+
fi
178+
169179
- name: Check configuration
170180
run: |
171181
${{ env.RUN_CMD }} python3 -c "from devito import configuration; print(''.join(['%s: %s \n' % (k, v) for (k, v) in configuration.items()]))"

.github/workflows/tutorials.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,30 @@ jobs:
7474
7575
- name: Set run prefix
7676
run: |
77-
if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py39' ]; then
77+
if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py310' ]; then
7878
echo "RUN_CMD=docker run --init -t --rm --name testrun devito_img" >> $GITHUB_ENV
7979
else
8080
echo "RUN_CMD=" >> $GITHUB_ENV
8181
fi
8282
id: set-run
8383

8484
- name: Install dependencies
85-
if: matrix.name != 'tutos-docker-gcc-py39'
85+
if: matrix.name != 'tutos-docker-gcc-py310'
8686
run: |
8787
python -m pip install --upgrade pip
8888
pip install -e .[tests,extras]
8989
pip install blosc
9090
91+
- name: Check Docker image Python version
92+
if: matrix.name == 'tutos-docker-gcc-py310'
93+
run: |
94+
declared_pyver="${{ matrix.pyver }}"
95+
actual_pyver=$(${{ env.RUN_CMD }} python3 --version | cut -d' ' -f2 | cut -d'.' -f1,2)
96+
if [ "$declared_pyver" != "$actual_pyver" ]; then
97+
echo "Python version mismatch: declared $declared_pyver, image has $actual_pyver"
98+
exit 1
99+
fi
100+
91101
- name: Seismic notebooks
92102
run: |
93103
${{ env.RUN_CMD }} py.test --nbval -k 'not dask' -k 'not synthetics' examples/seismic/tutorials/

0 commit comments

Comments
 (0)