From 4e91cc94baf84c2903ef1fbe1f4746b05352add8 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 19 May 2022 21:53:31 +0300 Subject: [PATCH] Test in the same step as build --- ...pload.yml => docker-build-test-upload.yml} | 10 +- .github/workflows/docker-test.yml | 36 ----- .github/workflows/docker.yml | 132 +++++------------- 3 files changed, 40 insertions(+), 138 deletions(-) rename .github/workflows/{docker-build-upload.yml => docker-build-test-upload.yml} (87%) delete mode 100644 .github/workflows/docker-test.yml diff --git a/.github/workflows/docker-build-upload.yml b/.github/workflows/docker-build-test-upload.yml similarity index 87% rename from .github/workflows/docker-build-upload.yml rename to .github/workflows/docker-build-test-upload.yml index 25e89770..46c7503d 100644 --- a/.github/workflows/docker-build-upload.yml +++ b/.github/workflows/docker-build-test-upload.yml @@ -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: workflow_call: @@ -21,7 +21,7 @@ on: type: string jobs: - build-upload: + build-test-upload: runs-on: ${{ inputs.runsOn }} steps: - name: Checkout Repo ⚡️ @@ -43,10 +43,14 @@ jobs: # Full logs for CI build BUILDKIT_PROGRESS: plain 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 💾 run: docker save jupyter/${{ inputs.image }} -o /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar shell: bash - - name: Upload image as artifact 💾 uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml deleted file mode 100644 index 8d0f7dd9..00000000 --- a/.github/workflows/docker-test.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6f801c72..9da264e8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,8 +7,7 @@ on: pull_request: paths: - ".github/workflows/docker.yml" - - ".github/workflows/docker-build-upload.yml" - - ".github/workflows/docker-test.yml" + - ".github/workflows/docker-build-test-upload.yml" - ".github/workflows/docker-tag-manifest-push.yml" - ".github/workflows/docker-wiki-update.yml" @@ -34,8 +33,7 @@ on: - master paths: - ".github/workflows/docker.yml" - - ".github/workflows/docker-build-upload.yml" - - ".github/workflows/docker-test.yml" + - ".github/workflows/docker-build-test-upload.yml" - ".github/workflows/docker-tag-manifest-push.yml" - ".github/workflows/docker-wiki-update.yml" @@ -63,152 +61,88 @@ concurrency: cancel-in-progress: true jobs: - build-amd64-base: - uses: ./.github/workflows/docker-build-upload.yml + amd64-base: + uses: ./.github/workflows/docker-build-test-upload.yml with: parentImage: "" image: base-notebook platform: amd64 runsOn: ubuntu-latest - test-amd64-base: - needs: [build-amd64-base] - uses: ./.github/workflows/docker-test.yml - with: - image: base-notebook - platform: amd64 - runsOn: ubuntu-latest - - build-amd64-minimal: - needs: [build-amd64-base] - uses: ./.github/workflows/docker-build-upload.yml + amd64-minimal: + needs: [amd64-base] + uses: ./.github/workflows/docker-build-test-upload.yml with: parentImage: base-notebook image: minimal-notebook platform: amd64 runsOn: ubuntu-latest - test-amd64-minimal: - needs: [build-amd64-minimal] - uses: ./.github/workflows/docker-test.yml - with: - image: minimal-notebook - platform: amd64 - runsOn: ubuntu-latest - - build-amd64-scipy: - needs: [build-amd64-minimal] - uses: ./.github/workflows/docker-build-upload.yml + amd64-scipy: + needs: [amd64-minimal] + uses: ./.github/workflows/docker-build-test-upload.yml with: parentImage: minimal-notebook image: scipy-notebook platform: amd64 runsOn: ubuntu-latest - test-amd64-scipy: - needs: [build-amd64-scipy] - uses: ./.github/workflows/docker-test.yml - with: - image: scipy-notebook - platform: amd64 - runsOn: ubuntu-latest - - build-amd64-r: - needs: [build-amd64-minimal] - uses: ./.github/workflows/docker-build-upload.yml + amd64-r: + needs: [amd64-minimal] + uses: ./.github/workflows/docker-build-test-upload.yml with: parentImage: minimal-notebook image: r-notebook platform: amd64 runsOn: ubuntu-latest - test-amd64-r: - needs: [build-amd64-r] - uses: ./.github/workflows/docker-test.yml - with: - image: r-notebook - platform: amd64 - runsOn: ubuntu-latest - - build-amd64-tensorflow: - needs: [build-amd64-scipy] - uses: ./.github/workflows/docker-build-upload.yml + amd64-tensorflow: + needs: [amd64-scipy] + uses: ./.github/workflows/docker-build-test-upload.yml with: parentImage: scipy-notebook image: tensorflow-notebook platform: amd64 runsOn: ubuntu-latest - test-amd64-tensorflow: - needs: [build-amd64-tensorflow] - uses: ./.github/workflows/docker-test.yml - with: - image: tensorflow-notebook - platform: amd64 - runsOn: ubuntu-latest - - build-amd64-datascience: - needs: [build-amd64-scipy] - uses: ./.github/workflows/docker-build-upload.yml + amd64-datascience: + needs: [amd64-scipy] + uses: ./.github/workflows/docker-build-test-upload.yml with: parentImage: scipy-notebook image: datascience-notebook platform: amd64 runsOn: ubuntu-latest - test-amd64-datascience: - needs: [build-amd64-datascience] - uses: ./.github/workflows/docker-test.yml - with: - image: datascience-notebook - platform: amd64 - runsOn: ubuntu-latest - - build-amd64-pyspark: - needs: [build-amd64-scipy] - uses: ./.github/workflows/docker-build-upload.yml + amd64-pyspark: + needs: [amd64-scipy] + uses: ./.github/workflows/docker-build-test-upload.yml with: parentImage: scipy-notebook image: pyspark-notebook platform: amd64 runsOn: ubuntu-latest - test-amd64-pyspark: - needs: [build-amd64-pyspark] - uses: ./.github/workflows/docker-test.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 + amd64-all-spark: + needs: [amd64-pyspark] + uses: ./.github/workflows/docker-build-test-upload.yml with: parentImage: pyspark-notebook image: all-spark-notebook platform: amd64 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: needs: [ - test-amd64-base, - test-amd64-minimal, - test-amd64-scipy, - test-amd64-r, - test-amd64-tensorflow, - test-amd64-datascience, - test-amd64-pyspark, - test-amd64-all-spark, + amd64-base, + amd64-minimal, + amd64-scipy, + amd64-r, + amd64-tensorflow, + amd64-datascience, + amd64-pyspark, + amd64-all-spark, ] uses: ./.github/workflows/docker-tag-manifest-push.yml with: