Run tests on multiple python versions and fix CI for Python 3.14 #832
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: unit_tests | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| unit_tests: | |
| name: unit_tests on '${{ matrix.os.name }}', Python ${{ matrix.py_version }} | |
| runs-on: ${{ matrix.os.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ | |
| { | |
| name: linux, | |
| runner: ubuntu-latest, | |
| python_venv_activate: source .venv/bin/activate, | |
| }, | |
| { | |
| name: macos, | |
| runner: macos-latest, | |
| python_venv_activate: source .venv/bin/activate, | |
| }, | |
| { | |
| name: windows, | |
| runner: windows-latest, | |
| python_venv_activate: .venv/Scripts/Activate.ps1, | |
| }, | |
| ] | |
| py_version: | |
| - '3.9' | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| - '3.14' | |
| - '3.x' # Explicit latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| if: matrix.os.name == 'linux' | |
| run: sudo apt-get install -y build-essential make binutils-mips-linux-gnu wget | |
| - name: Print Python version | |
| run: | | |
| python3 --version | |
| - name: Set up Python ${{ matrix.py_version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.py_version }} | |
| - name: Setup Python venv | |
| run: | | |
| python3 --version | |
| python3 -m venv .venv | |
| ${{ matrix.os.python_venv_activate }} | |
| python3 --version | |
| - name: Install Python dependencies | |
| run: | | |
| ${{ matrix.os.python_venv_activate }} | |
| python3 -m pip install -U -r requirements.txt | |
| python3 -m pip install -e . | |
| - name: Build `basic_app` on ${{ matrix.os.name }} | |
| if: matrix.os.name == 'linux' | |
| # Linux CI checks if any of the test C code has changed without updating the generated binary | |
| run: | | |
| make -C test/basic_app clean | |
| make -C test/basic_app download_kmc | |
| make -C test/basic_app all | |
| git diff --exit-code test/basic_app/build/basic_app.bin | |
| - name: Run the test | |
| run: | | |
| ${{ matrix.os.python_venv_activate }} | |
| python3 test.py |