From 19b2fc92c91c20a2ebc6fd46aff253d90ab489a6 Mon Sep 17 00:00:00 2001 From: Fried Hoeben Date: Mon, 13 Nov 2023 12:28:40 +0100 Subject: [PATCH] another try --- .github/workflows/other-build-test.yml | 109 +++++++++++++++++++------ 1 file changed, 82 insertions(+), 27 deletions(-) diff --git a/.github/workflows/other-build-test.yml b/.github/workflows/other-build-test.yml index 1423c59..9041b14 100644 --- a/.github/workflows/other-build-test.yml +++ b/.github/workflows/other-build-test.yml @@ -68,14 +68,26 @@ jobs: combine test-with-pdf chrome-with-pdf - load: true set: | *.tags= *.platform=${{ matrix.platform }} + test.output=type=docker,dest=/tmp/image-test.tar + combine.output=docker,dest=/tmp/image-combine.tar + chrome.output=docker,dest=/tmp/image-chrome.tar + test-with-pdf.output=docker,dest=/tmp/image-test-with-pdf.tar + chrome-with-pdf.output=docker,dest=/tmp/image-chrome-with-pdf.tar + + - name: Upload images + uses: actions/upload-artifact@v3 + with: + name: images + path: /tmp/image-*.tar + if-no-files-found: error + retention-days: 1 - name: Export digests run: | - echo "${{ fromJSON(steps.bake.outputs.metadata) }}" + echo "${{ steps.bake.outputs.metadata }}" mkdir -p /tmp/digests/test test_digest="${{ fromJSON(steps.bake.outputs.metadata)['test']['containerimage.digest'] }}" touch "/tmp/digests/test/${test_digest#sha256:}" @@ -100,39 +112,82 @@ jobs: if-no-files-found: error retention-days: 1 + test: + runs-on: ubuntu-latest + needs: + - build + strategy: + fail-fast: false + matrix: + target: [test, combine, chrome, test-with-pdf, chrome-with-pdf] + include: + - target: test + image: hsac/fitnesse-fixtures-test-jre11 + - target: combine + image: hsac/fitnesse-fixtures-combine + - target: chrome + image: hsac/fitnesse-fixtures-test-jre11-chrome + - target: test-with-pdf + image: hsac/fitnesse-fixtures-test-jre11-with-pdf + - target: chrome-with-pdf + image: hsac/fitnesse-fixtures-test-jre11-chrome-with-pdf + steps: + - name: Download meta bake definition + uses: actions/download-artifact@v3 + with: + name: bake-meta + path: /tmp + + - name: Download digests + uses: actions/download-artifact@v3 + with: + name: digests + path: /tmp/digests + + - name: Download images + uses: actions/download-artifact@v3 + with: + name: images + path: /tmp + + - name: Load image + run: | + docker load --input /tmp/image-${{ matrix.target }}.tar + docker image ls -a + - name: Test image - if: matrix.platform == 'linux/amd64' run: | - SHA="sha256:$(cd /tmp/digests/test; ls *)" - IMAGE="hsac/fitnesse-fixtures-test-jre11@${SHA}" + SHA="sha256:$(cd /tmp/digests/${{ matrix.target }}; ls *)" + IMAGE="${{ matrix.image }}@${SHA}" + echo "${IMAGE}" docker run --rm -v "$(pwd)"/src/main/wiki:/fitnesse/wiki/FitNesseRoot -e RE_RUN_FAILED=true ${IMAGE} -DfitnesseSuiteToRun=SampleTests.SlimTests.UtilityFixtures - - name: Build - id: bake-push - uses: docker/bake-action@v4 - with: - files: | - ./docker-bake.hcl - /tmp/bake-meta.json - targets: | - test - chrome - combine - test-with-pdf - chrome-with-pdf - set: | - *.tags= - *.platform=${{ matrix.platform }} - test.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11",push-by-digest=true,name-canonical=true,push=true - combine.output=type=image,"name=hsac/fitnesse-fixtures-combine",push-by-digest=true,name-canonical=true,push=true - chrome.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11-chrome",push-by-digest=true,name-canonical=true,push=true - test-with-pdf.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11-with-pdf",push-by-digest=true,name-canonical=true,push=true - chrome-with-pdf.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11-chrome-with-pdf",push-by-digest=true,name-canonical=true,push=true +# - name: Build +# id: bake-push +# uses: docker/bake-action@v4 +# with: +# files: | +# ./docker-bake.hcl +# /tmp/bake-meta.json +# targets: | +# test +# chrome +# combine +# test-with-pdf +# chrome-with-pdf +# set: | +# *.tags= +# *.platform=${{ matrix.platform }} +# test.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11",push-by-digest=true,name-canonical=true,push=true +# combine.output=type=image,"name=hsac/fitnesse-fixtures-combine",push-by-digest=true,name-canonical=true,push=true +# chrome.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11-chrome",push-by-digest=true,name-canonical=true,push=true +# test-with-pdf.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11-with-pdf",push-by-digest=true,name-canonical=true,push=true +# chrome-with-pdf.output=type=image,"name=hsac/fitnesse-fixtures-test-jre11-chrome-with-pdf",push-by-digest=true,name-canonical=true,push=true merge: runs-on: ubuntu-latest needs: - - build + - test strategy: fail-fast: false matrix: