compiler: Pass kwargs when invoking compiler passes #215
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Jupyter Notebooks | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| # Trigger the workflow on push or pull request, | |
| # but only for the main branch | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| tutorials: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| DEVITO_ARCH: "${{ matrix.compiler }}" | |
| DEVITO_LANGUAGE: ${{ matrix.language }} | |
| outputs: | |
| unique : ${{ steps.uniquetag.outputs.unique }} | |
| strategy: | |
| # Prevent all build to stop if a single one fails | |
| fail-fast: false | |
| matrix: | |
| name: [ | |
| tutos-ubuntu-gcc-py310, | |
| tutos-osx-clang-py311, | |
| tutos-docker-gcc-py310 | |
| ] | |
| include: | |
| - name: tutos-ubuntu-gcc-py310 | |
| os: ubuntu-latest | |
| compiler: gcc | |
| language: "openmp" | |
| pyver: "3.10" | |
| - name: tutos-osx-clang-py311 | |
| os: macos-latest | |
| compiler: clang | |
| language: "C" | |
| pyver: "3.11" | |
| - name: tutos-docker-gcc-py310 | |
| os: ubuntu-latest | |
| compiler: gcc | |
| language: "openmp" | |
| pyver: "3.10" | |
| steps: | |
| - name: Checkout devito | |
| uses: actions/checkout@v6 | |
| - name: Generate unique CI tag | |
| id: uniquetag | |
| run: | | |
| UNIQUE=$(echo "${GITHUB_RUN_ID}_${GITHUB_RUN_ATTEMPT}" | cksum | cut -f 1 -d " ") | |
| echo "Unique ID: ${UNIQUE}" | |
| echo "unique=${UNIQUE}" >> "$GITHUB_OUTPUT" | |
| - name: Set up Python ${{ matrix.pyver }} | |
| if: "!contains(matrix.name, 'docker')" | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.pyver }} | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| if: runner.os == 'macOS' | |
| with: | |
| xcode-version: latest-stable | |
| - name: Build docker image | |
| if: "contains(matrix.name, 'docker')" | |
| env: | |
| UNIQUE: ${{ steps.uniquetag.outputs.unique }} | |
| run: | | |
| docker build \ | |
| --pull \ | |
| --file docker/Dockerfile.devito \ | |
| --tag "devito_img${UNIQUE}" \ | |
| . | |
| - name: Set run prefix | |
| env: | |
| UNIQUE: ${{ steps.uniquetag.outputs.unique }} | |
| run: | | |
| if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py310' ]; then | |
| echo "RUN_CMD=docker run \ | |
| --init -t --rm \ | |
| --name testrun \ | |
| devito_img${UNIQUE}" >> "$GITHUB_ENV" | |
| else | |
| echo "RUN_CMD=" >> "$GITHUB_ENV" | |
| fi | |
| id: set-run | |
| - name: Install dependencies | |
| if: matrix.name != 'tutos-docker-gcc-py310' | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[tests,extras]" | |
| pip install blosc | |
| - name: Check Docker image Python version | |
| if: matrix.name == 'tutos-docker-gcc-py310' | |
| run: | | |
| declared_pyver="${{ matrix.pyver }}" | |
| actual_pyver=$(${{ env.RUN_CMD }} python3 --version | cut -d' ' -f2 | cut -d'.' -f1,2) | |
| echo "Declared Python version: $declared_pyver" | |
| echo "Actual Python version: $actual_pyver" | |
| if [ "$declared_pyver" != "$actual_pyver" ]; then | |
| echo "Python version mismatch: declared $declared_pyver, image has $actual_pyver" | |
| exit 1 | |
| fi | |
| - name: Seismic notebooks | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval -k 'not dask' -k 'not synthetics' examples/seismic/tutorials/ | |
| ${{ env.RUN_CMD }} py.test --nbval examples/seismic/acoustic/accuracy.ipynb | |
| - name: Failing notebooks | |
| continue-on-error: true | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/seismic/tutorials/14_creating_synthetics.ipynb | |
| - name: Dask notebooks | |
| if: runner.os != 'macOS' | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/seismic/tutorials/*dask*.ipynb | |
| - name: Self-adjoint notebooks | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/seismic/self_adjoint/ | |
| - name: CFD notebooks | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/cfd | |
| - name: User api notebooks | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/userapi | |
| - name: Compiler notebooks | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/compiler | |
| - name: Finance notebooks | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/finance | |
| - name: Performance notebooks | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/performance | |
| - name: ABC Notebooks | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/seismic/abc_methods | |
| - name: Timestepping Notebooks | |
| run: | | |
| ${{ env.RUN_CMD }} py.test --nbval examples/timestepping | |
| - name: Cleanup Docker | |
| if: "contains(matrix.name, 'docker')" | |
| env: | |
| UNIQUE: ${{ steps.uniquetag.outputs.unique }} | |
| run: | | |
| docker image rm -f "devito_img${UNIQUE}" |