Merge pull request #156 from DeepLabCut/cy/expand-testing #371
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.10", "3.11", "3.12"] | |
| include: | |
| - os: ubuntu-latest | |
| path: ~/.cache/pip | |
| - os: macos-latest | |
| path: ~/Library/Caches/pip | |
| - os: windows-latest | |
| path: ~\AppData\Local\pip\Cache | |
| exclude: | |
| - os: windows-latest | |
| python-version: "3.11" | |
| - os: windows-latest | |
| python-version: "3.12" | |
| steps: | |
| - name: Free up disk space | |
| if: runner.os == 'Linux' | |
| run: | | |
| echo "Disk space before cleanup:" | |
| df -h | |
| # Remove unnecessary software to free up disk space | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| echo "Disk space after cleanup:" | |
| df -h | |
| - name: Checkout code | |
| uses: actions/checkout@v4 # uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| version: "0.9.5" | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install the project | |
| run: uv sync --all-extras --dev | |
| shell: bash | |
| - name: Install ffmpeg | |
| run: | | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo apt-get update | |
| sudo apt-get install ffmpeg | |
| elif [ "$RUNNER_OS" == "macOS" ]; then | |
| brew install ffmpeg | |
| else | |
| choco install ffmpeg | |
| fi | |
| shell: bash | |
| - name: Run Model Benchmark Test | |
| run: uv run dlc-live-test --nodisplay | |
| - name: Run DLC Live Unit Tests | |
| run: uv run pytest | |
| # - name: Run DLC Live Unit Tests | |
| # run: uv run pytest --cov=dlclive --cov-report=xml --cov-report=term-missing | |
| # - name: Coverage Report | |
| # uses: codecov/codecov-action@v5 | |
| # with: | |
| # files: ./coverage.xml | |
| # flags: ${{ matrix.os }}-py${{ matrix.python-version }} | |
| # name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} | |
| # - name: Add coverage to job summary | |
| # if: always() | |
| # shell: bash | |
| # run: | | |
| # uv run python -m coverage report -m > coverage.txt | |
| # echo "## Coverage (dlclive)" >> "$GITHUB_STEP_SUMMARY" | |
| # echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| # cat coverage.txt >> "$GITHUB_STEP_SUMMARY" | |
| # echo '```' >> "$GITHUB_STEP_SUMMARY" |