From 3a4ce93e19986234d96ae7fcba68dc0765083af9 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 27 Nov 2023 17:43:04 +0000 Subject: [PATCH] CI: Add test_codegen.py job which only tests_codegen.py in isolation (no cuda dependency) --- .github/workflows/test_codegen.yml | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/test_codegen.yml diff --git a/.github/workflows/test_codegen.yml b/.github/workflows/test_codegen.yml new file mode 100644 index 000000000..a0c1b30a9 --- /dev/null +++ b/.github/workflows/test_codegen.yml @@ -0,0 +1,57 @@ +# Test codegen.py in isolation of cuda. +name: test_codegen.py + +on: + # Branch pushes to codegen related files + push: + branches: + - '**' + paths: + - ".github/workflows/test_codegen.yml" + - "swig/python/codegen/**" + - "tests/python/codegen/test_codegen.py" + # Allow manual invocation. + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + configure: + runs-on: ${{ matrix.cudacxx.os }} + strategy: + fail-fast: false + # Multiplicative build matrix + matrix: + python: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + + # Name the job based on matrix/env options + name: "test_codegen ${{matrix.python}}" + + # Define job-wide env constants, and promote matrix elements to env constants for portable steps. + env: + PYTHON: ${{ matrix.python}} + + steps: + - uses: actions/checkout@v3 + + - name: Select Python + if: ${{ env.PYTHON != ''}} + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON }} + + - name: Install python dependencies + if: ${{ env.PYTHON != ''}} + run: | + python3 -m pip install --upgrade pytest astpretty + + - name: Run pytest on codegen.py + run: | + python3 -m pytest tests/python/codegen/test_codegen.py