Free up disk space on Pull Request Test CI #782
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
# Any PR opened, build images and run tests | |
name: Test | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
env: | |
DOCKER_ORG: pangeo | |
GITHUB_SHA: ${{ github.sha }} | |
GITHUB_REF: ${{ github.ref }} | |
jobs: | |
matrix-build: | |
strategy: | |
fail-fast: false | |
matrix: | |
IMAGE: [base-notebook, pangeo-notebook, ml-notebook, pytorch-notebook, forge] | |
name: ${{ matrix.IMAGE }} | |
runs-on: ubuntu-latest | |
services: | |
# https://github.com/docker/build-push-action/blob/master/docs/advanced/local-registry.md#local-registry | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 | |
- name: Free up disk space | |
run: | | |
df -h | |
docker image ls | |
sudo apt clean | |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc | |
df -h | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver-opts: network=host | |
- name: Build base-image | |
uses: docker/build-push-action@v3 | |
with: | |
context: base-image | |
tags: localhost:5000/pangeo/base-image:PR | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Build Only | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ matrix.IMAGE }} | |
push: true | |
tags: localhost:5000/${{env.DOCKER_ORG}}/${{ matrix.IMAGE }}:PR | |
build-args: PANGEO_BASE_IMAGE_TAG=PR | |
build-contexts: | | |
pangeo/base-image:PR=docker-image://localhost:5000/pangeo/base-image:PR | |
- name: Report Image Size and Conda Packages | |
run: | | |
docker run localhost:5000/${DOCKER_ORG}/${{ matrix.IMAGE }}:PR conda list --export | |
docker images ls | |
- name: Test Image | |
run: | | |
docker run -u 1000 -w /srv/test -v $PWD:/srv/test localhost:5000/${DOCKER_ORG}/${{ matrix.IMAGE }}:PR ./run_tests.sh ${{ matrix.IMAGE }} |