Pin dependencies #4760
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 Integration with dandi-cli | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - "web/**" | |
| pull_request: | |
| paths-ignore: | |
| - "web/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-image: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out this repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # fetch history for all branches and tags | |
| - name: Build Docker image | |
| run: | | |
| docker build \ | |
| -t dandiarchive/dandiarchive-api \ | |
| -f dev/django-public.Dockerfile \ | |
| . | |
| - name: Export Docker image | |
| run: | | |
| docker image save -o dandiarchive-api.tgz dandiarchive/dandiarchive-api | |
| - name: Upload Docker image tarball | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dandiarchive-api.tgz | |
| path: dandiarchive-api.tgz | |
| test: | |
| runs-on: ubuntu-24.04 | |
| needs: build-image | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: | |
| - "3.13" | |
| dandi-version: | |
| - release | |
| - master | |
| env: | |
| DANDI_TESTS_PULL_DOCKER_COMPOSE: 0 | |
| steps: | |
| - name: Download Docker image tarball | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: dandiarchive-api.tgz | |
| - name: Import Docker image | |
| run: docker image load -i dandiarchive-api.tgz | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Run dandi-api tests in dandi-cli | |
| if: matrix.dandi-version == 'release' | |
| run: > | |
| uvx --with dandi[test] | |
| pytest --pyargs -v -s --dandi-api dandi | |
| env: | |
| DANDI_TESTS_PERSIST_DOCKER_COMPOSE: "1" | |
| - name: Run dandi-api tests in dandi-cli | |
| if: matrix.dandi-version == 'master' | |
| run: > | |
| uvx --with "dandi[test] @ git+https://github.com/dandi/dandi-cli" | |
| pytest --pyargs -v -s --dandi-api dandi | |
| env: | |
| DANDI_TESTS_PERSIST_DOCKER_COMPOSE: "1" | |
| - name: Dump Docker Compose logs | |
| if: failure() | |
| run: | | |
| DANDI_PATH=$(uv run --with dandi python -c "import dandi; import os; print(os.path.dirname(dandi.__file__))") | |
| docker compose \ | |
| -f "$DANDI_PATH/tests/data/dandiarchive-docker/docker-compose.yml" \ | |
| logs --timestamps | |
| - name: Shut down Docker Compose | |
| run: | | |
| DANDI_PATH=$(uv run --with dandi python -c "import dandi; import os; print(os.path.dirname(dandi.__file__))") | |
| docker compose \ | |
| -f "$DANDI_PATH/tests/data/dandiarchive-docker/docker-compose.yml" \ | |
| down -v |