Skip to content

added github action to test and push tutorials container #1

added github action to test and push tutorials container

added github action to test and push tutorials container #1

Workflow file for this run

name: Test container build and tutorials
on:
# pull_request is used for test purposes only
pull_request:
branches:
- main
push:
branches:
- main
env:
TUTORIAL_TAG: tutorial_tag_local
TUTORIAL_IMAGE_NAME: tutorial_image
jobs:
build:
name: Build container locally
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: ./src/
file: ./docker/Dockerfile
build-args: |
TUTORIAL_NAME=latest
tags: ${{ env.TUTORIAL_TAG }}
outputs: type=docker,dest=/tmp/${{ env.TUTORIAL_IMAGE_NAME }}.tar
- uses: actions/upload-artifact@v4
with:
name: ${{ env.TUTORIAL_IMAGE_NAME }}
path: /tmp/${{ env.TUTORIAL_IMAGE_NAME }}.tar
tests:
name: Test tutorials from docker container
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
tutorial: ['radical-pilot', 'radical-entk', 'parsl-rp', 'deepdrivemd']
env:
TARGET_PATH: /tutorials/${{ matrix.tutorial }}/*.ipynb
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ env.TUTORIAL_IMAGE_NAME }}
path: /tmp
- name: Load tutorial image
run: |
docker load --input /tmp/${{ env.TUTORIAL_IMAGE_NAME }}.tar
docker image ls -a
- name: Run tutorials
run: |
docker run ${{ env.TUTORIAL_TAG }} bash -c "\
jupyter nbconvert --clear-output --inplace ${{ env.TARGET_PATH }} && \
jupyter nbconvert --to notebook --execute --inplace ${{ env.TARGET_PATH }}"
deploy:
needs: tests
uses: ./.github/workflows/deploy.yml
secrets: inherit