Split core dependencies from models extra #93
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: Test WSI to embedding consistency | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: | |
| jobs: | |
| regression-guards: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Run regression guard tests | |
| run: | | |
| set -euo pipefail | |
| python -m unittest discover -s test -p 'test_regression_bugfixes.py' | |
| docker-test: | |
| needs: regression-guards | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| actions: write # needed for Buildx GHA cache | |
| # don't run secret-using job on forked PRs | |
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Free disk space on runner | |
| run: | | |
| set -euxo pipefail | |
| df -h | |
| sudo rm -rf /usr/local/lib/android || true | |
| sudo rm -rf /usr/share/dotnet || true | |
| sudo rm -rf /opt/ghc || true | |
| sudo rm -rf "${AGENT_TOOLSDIRECTORY:-/opt/hostedtoolcache}" || true | |
| docker system prune -af || true | |
| sudo apt-get clean | |
| df -h | |
| - name: Build image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile.ci | |
| push: false | |
| load: true | |
| tags: slide2vec-ci:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Guard required secret (if needed) | |
| if: ${{ github.event_name != 'pull_request' }} # or drop the condition if PRs from same repo need it | |
| run: | | |
| set -euo pipefail | |
| test -n "${HF_TOKEN:-}" || { echo "HF_TOKEN is required but not set"; exit 1; } | |
| - name: Run test suite in container | |
| run: | | |
| set -euo pipefail | |
| docker run --rm \ | |
| -e HF_TOKEN="$HF_TOKEN" \ | |
| -v "$GITHUB_WORKSPACE:/opt/app" \ | |
| slide2vec-ci:${{ github.sha }} \ | |
| bash -lc "python -m pip install --no-cache-dir pytest pytest-cov && python -m pytest -q tests" | |