Merge pull request #74 from UnravelSports/feat/docs #185
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: Run Tests and Check Formatting | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| include: | |
| # Python 3.11 with Spektral/TensorFlow | |
| - os: ubuntu-latest | |
| python-version: '3.11' | |
| test-deps: 'test-py311' | |
| pytest-markers: '' | |
| - os: windows-latest | |
| python-version: '3.11' | |
| test-deps: 'test-py311' | |
| pytest-markers: '' | |
| - os: macos-latest | |
| python-version: '3.11' | |
| test-deps: 'test-py311' | |
| pytest-markers: '' | |
| # Python 3.12 with PyTorch only | |
| - os: ubuntu-latest | |
| python-version: '3.12' | |
| test-deps: 'test-torch' | |
| pytest-markers: '-m "not spektral"' | |
| - os: windows-latest | |
| python-version: '3.12' | |
| test-deps: 'test-torch' | |
| pytest-markers: '-m "not spektral"' | |
| - os: macos-latest | |
| python-version: '3.12' | |
| test-deps: 'test-torch' | |
| pytest-markers: '-m "not spektral"' | |
| # Python 3.13 with PyTorch only | |
| - os: ubuntu-latest | |
| python-version: '3.13' | |
| test-deps: 'test-torch' | |
| pytest-markers: '-m "not spektral"' | |
| - os: windows-latest | |
| python-version: '3.13' | |
| test-deps: 'test-torch' | |
| pytest-markers: '-m "not spektral"' | |
| - os: macos-latest | |
| python-version: '3.13' | |
| test-deps: 'test-torch' | |
| pytest-markers: '-m "not spektral"' | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Free up disk space (Linux only) | |
| if: runner.os == 'Linux' | |
| run: | | |
| echo "Disk space before cleanup:" | |
| df -h | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /usr/local/share/boost | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| sudo docker image prune --all --force | |
| echo "Disk space after cleanup:" | |
| df -h | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # Linux/macOS - Install dependencies | |
| - name: Install dependencies (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| env: | |
| PYTHONIOENCODING: utf-8 | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[${{ matrix.test-deps }}] | |
| shell: bash | |
| # Windows - Install dependencies | |
| - name: Install dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| env: | |
| PYTHONIOENCODING: utf-8 | |
| PYTHONUTF8: 1 | |
| run: | | |
| chcp 65001 | |
| python -m pip install --upgrade pip setuptools | |
| python -m pip install -e .[${{ matrix.test-deps }}] | |
| shell: pwsh | |
| - name: Code formatting | |
| run: | | |
| pip install "black[jupyter]==24.4.2" | |
| black --check . | |
| - name: Test with pytest | |
| run: | | |
| pytest --color=yes ${{ matrix.pytest-markers }} |