Test in the same step as build

This commit is contained in:
Ayaz Salikhov
2022-05-19 21:53:31 +03:00
parent 0602872f90
commit 4e91cc94ba
3 changed files with 40 additions and 138 deletions

View File

@@ -1,4 +1,4 @@
name: Download parent image, build new one, upload it to GitHub artifacts name: Download parent image, build new one, test it and upload to GitHub artifacts
on: on:
workflow_call: workflow_call:
@@ -21,7 +21,7 @@ on:
type: string type: string
jobs: jobs:
build-upload: build-test-upload:
runs-on: ${{ inputs.runsOn }} runs-on: ${{ inputs.runsOn }}
steps: steps:
- name: Checkout Repo ⚡️ - name: Checkout Repo ⚡️
@@ -43,10 +43,14 @@ jobs:
# Full logs for CI build # Full logs for CI build
BUILDKIT_PROGRESS: plain BUILDKIT_PROGRESS: plain
shell: bash shell: bash
- name: Run tests ✅
run: python3 -m tests.run_tests --short-image-name ${{ inputs.image }}
shell: bash
- name: Save image as a tar for later use 💾 - name: Save image as a tar for later use 💾
run: docker save jupyter/${{ inputs.image }} -o /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar run: docker save jupyter/${{ inputs.image }} -o /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar
shell: bash shell: bash
- name: Upload image as artifact 💾 - name: Upload image as artifact 💾
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View File

@@ -1,36 +0,0 @@
name: Download image artifact from GitHub artifacts and test it
on:
workflow_call:
inputs:
image:
description: Image name
required: true
type: string
platform:
description: Image platform
required: true
type: string
runsOn:
description: GitHub Actions Runner image
required: true
type: string
jobs:
test:
runs-on: ${{ inputs.runsOn }}
steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v3
- name: Create dev environment 📦
uses: ./.github/actions/create-dev-env
- name: Load image to docker 📥
uses: ./.github/actions/load-image
with:
image: ${{ inputs.image }}
platform: ${{ inputs.platform }}
- name: Run tests ✅
run: python3 -m tests.run_tests --short-image-name ${{ inputs.image }}
shell: bash

View File

@@ -7,8 +7,7 @@ on:
pull_request: pull_request:
paths: paths:
- ".github/workflows/docker.yml" - ".github/workflows/docker.yml"
- ".github/workflows/docker-build-upload.yml" - ".github/workflows/docker-build-test-upload.yml"
- ".github/workflows/docker-test.yml"
- ".github/workflows/docker-tag-manifest-push.yml" - ".github/workflows/docker-tag-manifest-push.yml"
- ".github/workflows/docker-wiki-update.yml" - ".github/workflows/docker-wiki-update.yml"
@@ -34,8 +33,7 @@ on:
- master - master
paths: paths:
- ".github/workflows/docker.yml" - ".github/workflows/docker.yml"
- ".github/workflows/docker-build-upload.yml" - ".github/workflows/docker-build-test-upload.yml"
- ".github/workflows/docker-test.yml"
- ".github/workflows/docker-tag-manifest-push.yml" - ".github/workflows/docker-tag-manifest-push.yml"
- ".github/workflows/docker-wiki-update.yml" - ".github/workflows/docker-wiki-update.yml"
@@ -63,152 +61,88 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
build-amd64-base: amd64-base:
uses: ./.github/workflows/docker-build-upload.yml uses: ./.github/workflows/docker-build-test-upload.yml
with: with:
parentImage: "" parentImage: ""
image: base-notebook image: base-notebook
platform: amd64 platform: amd64
runsOn: ubuntu-latest runsOn: ubuntu-latest
test-amd64-base: amd64-minimal:
needs: [build-amd64-base] needs: [amd64-base]
uses: ./.github/workflows/docker-test.yml uses: ./.github/workflows/docker-build-test-upload.yml
with:
image: base-notebook
platform: amd64
runsOn: ubuntu-latest
build-amd64-minimal:
needs: [build-amd64-base]
uses: ./.github/workflows/docker-build-upload.yml
with: with:
parentImage: base-notebook parentImage: base-notebook
image: minimal-notebook image: minimal-notebook
platform: amd64 platform: amd64
runsOn: ubuntu-latest runsOn: ubuntu-latest
test-amd64-minimal: amd64-scipy:
needs: [build-amd64-minimal] needs: [amd64-minimal]
uses: ./.github/workflows/docker-test.yml uses: ./.github/workflows/docker-build-test-upload.yml
with:
image: minimal-notebook
platform: amd64
runsOn: ubuntu-latest
build-amd64-scipy:
needs: [build-amd64-minimal]
uses: ./.github/workflows/docker-build-upload.yml
with: with:
parentImage: minimal-notebook parentImage: minimal-notebook
image: scipy-notebook image: scipy-notebook
platform: amd64 platform: amd64
runsOn: ubuntu-latest runsOn: ubuntu-latest
test-amd64-scipy: amd64-r:
needs: [build-amd64-scipy] needs: [amd64-minimal]
uses: ./.github/workflows/docker-test.yml uses: ./.github/workflows/docker-build-test-upload.yml
with:
image: scipy-notebook
platform: amd64
runsOn: ubuntu-latest
build-amd64-r:
needs: [build-amd64-minimal]
uses: ./.github/workflows/docker-build-upload.yml
with: with:
parentImage: minimal-notebook parentImage: minimal-notebook
image: r-notebook image: r-notebook
platform: amd64 platform: amd64
runsOn: ubuntu-latest runsOn: ubuntu-latest
test-amd64-r: amd64-tensorflow:
needs: [build-amd64-r] needs: [amd64-scipy]
uses: ./.github/workflows/docker-test.yml uses: ./.github/workflows/docker-build-test-upload.yml
with:
image: r-notebook
platform: amd64
runsOn: ubuntu-latest
build-amd64-tensorflow:
needs: [build-amd64-scipy]
uses: ./.github/workflows/docker-build-upload.yml
with: with:
parentImage: scipy-notebook parentImage: scipy-notebook
image: tensorflow-notebook image: tensorflow-notebook
platform: amd64 platform: amd64
runsOn: ubuntu-latest runsOn: ubuntu-latest
test-amd64-tensorflow: amd64-datascience:
needs: [build-amd64-tensorflow] needs: [amd64-scipy]
uses: ./.github/workflows/docker-test.yml uses: ./.github/workflows/docker-build-test-upload.yml
with:
image: tensorflow-notebook
platform: amd64
runsOn: ubuntu-latest
build-amd64-datascience:
needs: [build-amd64-scipy]
uses: ./.github/workflows/docker-build-upload.yml
with: with:
parentImage: scipy-notebook parentImage: scipy-notebook
image: datascience-notebook image: datascience-notebook
platform: amd64 platform: amd64
runsOn: ubuntu-latest runsOn: ubuntu-latest
test-amd64-datascience: amd64-pyspark:
needs: [build-amd64-datascience] needs: [amd64-scipy]
uses: ./.github/workflows/docker-test.yml uses: ./.github/workflows/docker-build-test-upload.yml
with:
image: datascience-notebook
platform: amd64
runsOn: ubuntu-latest
build-amd64-pyspark:
needs: [build-amd64-scipy]
uses: ./.github/workflows/docker-build-upload.yml
with: with:
parentImage: scipy-notebook parentImage: scipy-notebook
image: pyspark-notebook image: pyspark-notebook
platform: amd64 platform: amd64
runsOn: ubuntu-latest runsOn: ubuntu-latest
test-amd64-pyspark: amd64-all-spark:
needs: [build-amd64-pyspark] needs: [amd64-pyspark]
uses: ./.github/workflows/docker-test.yml uses: ./.github/workflows/docker-build-test-upload.yml
with:
image: pyspark-notebook
platform: amd64
runsOn: ubuntu-latest
build-amd64-all-spark:
needs: [build-amd64-pyspark]
uses: ./.github/workflows/docker-build-upload.yml
with: with:
parentImage: pyspark-notebook parentImage: pyspark-notebook
image: all-spark-notebook image: all-spark-notebook
platform: amd64 platform: amd64
runsOn: ubuntu-latest runsOn: ubuntu-latest
test-amd64-all-spark:
needs: [build-amd64-all-spark]
uses: ./.github/workflows/docker-test.yml
with:
image: all-spark-notebook
platform: amd64
runsOn: ubuntu-latest
amd64-images-tag-push: amd64-images-tag-push:
needs: needs:
[ [
test-amd64-base, amd64-base,
test-amd64-minimal, amd64-minimal,
test-amd64-scipy, amd64-scipy,
test-amd64-r, amd64-r,
test-amd64-tensorflow, amd64-tensorflow,
test-amd64-datascience, amd64-datascience,
test-amd64-pyspark, amd64-pyspark,
test-amd64-all-spark, amd64-all-spark,
] ]
uses: ./.github/workflows/docker-tag-manifest-push.yml uses: ./.github/workflows/docker-tag-manifest-push.yml
with: with: