Cahce dependencies in CI to speedup workflows #92
Workflow file for this run
This file contains 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 Docker images and Binder integration | |
on: | |
push: | |
branches: [main] | |
paths: | |
- .binder/* | |
- Dockerfile | |
- pyproject.toml | |
pull_request: | |
branches: [main] | |
paths: | |
- .binder/* | |
- Dockerfile | |
- pyproject.toml | |
jobs: | |
test-docker-image: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: test-docker-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: generate envs | |
run: | | |
pip install tomli | |
make full-environment.yml | |
- name: Build and test | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
load: true | |
target: full | |
tags: hydromt | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Run Tests | |
run: docker run --rm hydromt pytest | |
- name: Test Binder integration with repo2docker | |
run: | | |
pip install jupyter-repo2docker | |
repo2docker . echo 'success!' |