Run python tests #6
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: python_tests | |
| run-name: Run python tests | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| python-version: '3.11' | |
| - os: ubuntu-latest | |
| python-version: '3.12' | |
| - os: windows-latest | |
| python-version: '3.12' | |
| - os: macos-latest | |
| python-version: '3.12' | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Install python and dependencies | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install requirements (Windows) | |
| if: runner.os == 'Windows' | |
| run: python -m pip install -r requirements-test.txt | |
| - name: Install requirements (Unix) | |
| if: runner.os != 'Windows' | |
| run: pip install -r requirements-test.txt | |
| - name: Run tests | |
| run: pytest examples/python_package |