Merge pull request #99 from imedslab/update-test-release #79
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 (Test & Lint) | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| test-all: | |
| name: Test Master Branch | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Update pip | |
| run: python -m pip install --upgrade pip | |
| - name: Install wheel and build tools | |
| run: python -m pip install --upgrade wheel build | |
| - name: Install PyTorch and dependencies | |
| run: | | |
| pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu | |
| pip install -r ci/requirements.txt | |
| pip install . --no-deps | |
| - name: Run tests | |
| run: pytest tests --cov solt --cov-report=xml --junitxml=./junit.xml | |
| - name: Check code formatting | |
| run: black --config=black.toml --check . | |
| - name: Run flake8 linter | |
| run: flake8 | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |