Add CI workflow and tests #3
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: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| test-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake g++ ninja-build | |
| - name: Build source distribution | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| python -m build --sdist | |
| - name: Create venv and install package | |
| run: | | |
| python -m venv .venv | |
| . .venv/bin/activate | |
| python -m pip install --upgrade pip | |
| python -m pip install pytest dist/*.tar.gz | |
| - name: Run pytest from tests directory | |
| run: | | |
| . .venv/bin/activate | |
| cd tests | |
| pytest -q | |
| test-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Install system dependencies | |
| run: | | |
| brew update | |
| brew install libtool | |
| - name: Build source distribution | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| python -m build --sdist | |
| - name: Create venv and install package | |
| run: | | |
| python -m venv .venv | |
| . .venv/bin/activate | |
| python -m pip install --upgrade pip | |
| python -m pip install pytest dist/*.tar.gz | |
| - name: Run pytest from tests directory | |
| run: | | |
| . .venv/bin/activate | |
| cd tests | |
| pytest -q | |
| test-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Set up MSYS2 toolchain | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: UCRT64 | |
| path-type: inherit | |
| update: true | |
| install: >- | |
| mingw-w64-ucrt-x86_64-gcc | |
| make | |
| - name: Build source distribution | |
| shell: pwsh | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| python -m build --sdist | |
| - name: Create venv and install package | |
| shell: pwsh | |
| run: | | |
| python -m venv .venv | |
| .\.venv\Scripts\Activate.ps1 | |
| python -m pip install --upgrade pip | |
| python -m pip install pytest (Get-ChildItem dist\*.tar.gz | Select-Object -First 1).FullName | |
| - name: Run pytest from tests directory | |
| shell: pwsh | |
| run: | | |
| .\.venv\Scripts\Activate.ps1 | |
| Set-Location tests | |
| pytest -q |