Skip to content

update test.yaml to only run if the image config files updated #32

update test.yaml to only run if the image config files updated

update test.yaml to only run if the image config files updated #32

Workflow file for this run

name: Build and test container image
on:
pull_request:
jobs:
test-build:
runs-on: ubuntu-latest
env:
DOCKER_CONFIG: $HOME/.docker
steps:
# For biggish images, github actions runs out of disk space.
# So we cleanup some unwanted things in the disk image, and reclaim that space for our docker use
# https://github.com/actions/virtual-environments/issues/2606#issuecomment-772683150
# and https://github.com/easimon/maximize-build-space/blob/b4d02c14493a9653fe7af06cc89ca5298071c66e/action.yml#L104
# This gives us a total of about 52G of free space, which should be enough for now
- name: Cleanup disk space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
df -h
- name: Checkout files in repo
uses: actions/checkout@main
- name: See if the image config changed
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
!.github/workflows/**
!images/**
!image-tests/**
**.bash
**.py
**.r
**.R
**.sh
**.txt
**.yaml
**.yml
Dockerfile
infra-requirements.txt
postBuild
requirements.txt
start
files_ignore: .github/**
- name: is this working
# if: steps.changed-files.outputs.any_changed == 'true'
env:
TEST_ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "One or more test file(s) has changed."
echo "List all the files that have changed: $TEST_ALL_CHANGED_FILES"
- name: Build and test the image if any image file changed
if: steps.changed-files.outputs.any_changed == 'true'
uses: jupyterhub/repo2docker-action@master
with:
# Make sure username & password/token pair matches your registry credentials
DOCKER_REGISTRY: us-central1-docker.pkg.dev
IMAGE_NAME: ucb-datahub-2018/user-images/logodev-user-image
NO_PUSH: "true"
# Put repo contents in /srv/repo, rather than the default (/home/jovyan). The home directory
# is mounted over by persistent storage when we are using the built image in a JupyterHub, and
# so all contents put in /home/jovyan are lost. This particularly prevents any 'start' script from
# working, as it is needed in runtime.
REPO_DIR: /srv/repo
# Lets us monitor disks getting full as images get bigger over time
- name: Show how much disk space is left
run: df -h