Skip to content

add linters

add linters #293

Workflow file for this run

name: Test Docker images
on:
pull_request:
paths:
- "Dockerfile.*"
- "dask-worker/*"
- "jupyterhub/*"
- "jupyterlab/*"
- "scripts/*"
- ".github/workflows/build-push-docker.yaml"
- ".github/workflows/test-images.yaml"
env:
DOCKER_ORG: nebari
GITHUB_SHA: ${{ github.sha }}
GPU_BASE_IMAGE: nvidia/cuda:12.2.2-base-ubuntu20.04
GPU_IMAGE_SUFFIX: gpu
BASE_IMAGE: ubuntu:20.04
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-test-images:
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile:
- jupyterlab
- jupyterhub
- dask-worker
platform:
- gpu
- cpu
exclude:
# excludes JupyterHub/GPU
- dockerfile: jupyterhub
platform: gpu
steps:
- name: Checkout Repository 🛎
uses: actions/checkout@v3
- name: Lint Dockerfiles 🔍
uses: jbergstroem/hadolint-gh-action@v1
with:
dockerfile: Dockerfile.${{ matrix.dockerfile }}
output_format: tty
error_level: 0
- name: "Set BASE_IMAGE and Image Suffix 📷"
if: ${{ matrix.platform == 'gpu' }}
run: |
echo "GPU Platform Matrix"
echo "BASE_IMAGE=$GPU_BASE_IMAGE" >> $GITHUB_ENV
echo "IMAGE_SUFFIX=-$GPU_IMAGE_SUFFIX" >> $GITHUB_ENV
- name: Build Image 🛠
run: |
docker build -t ${DOCKER_ORG}/${{ matrix.dockerfile }}${{ env.IMAGE_SUFFIX }}:${{ env.GITHUB_SHA }} \
--build-arg BASE_IMAGE=$BASE_IMAGE \
-f Dockerfile.${{ matrix.dockerfile }} .