Skip to content

fix waiting for xvfb #8

fix waiting for xvfb

fix waiting for xvfb #8

name: publish-cross-platform-images
on:
push:
branches:
- '*'
paths-ignore:
- '.github/dependabot.yml'
- '*.sh'
- 'README.md'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
platform: [linux/amd64, linux/arm64]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
hsac/fitnesse-fixtures-test-jre11
hsac/fitnesse-fixtures-combine
hsac/fitnesse-fixtures-test-jre11-chrome
hsac/fitnesse-fixtures-test-jre11-with-pdf
hsac/fitnesse-fixtures-test-jre11-chrome-with-pdf
- name: Rename meta bake definition file
run: |
mv "${{ steps.meta.outputs.bake-file }}" "/tmp/bake-meta.json"
- name: Upload meta bake definition
uses: actions/upload-artifact@v3
with:
name: bake-meta
path: /tmp/bake-meta.json
if-no-files-found: error
retention-days: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build
id: bake
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: Export digests
id: digests
run: |
mkdir -p /tmp/digests/test
test_digest="${{ fromJSON(steps.bake.outputs.metadata)['test']['containerimage.digest'] }}"
touch "/tmp/digests/test/${test_digest#sha256:}"
echo "test-image=hsac/fitnesse-fixtures-test-jre11@${test_digest}" >> $GITHUB_OUTPUT
mkdir -p /tmp/digests/combine
combine_digest="${{ fromJSON(steps.bake.outputs.metadata)['combine']['containerimage.digest'] }}"
touch "/tmp/digests/combine/${combine_digest#sha256:}"
echo "combine-image=hsac/fitnesse-fixtures-combine@${combine_digest}" >> $GITHUB_OUTPUT
mkdir -p /tmp/digests/chrome
chrome_digest="${{ fromJSON(steps.bake.outputs.metadata)['chrome']['containerimage.digest'] }}"
touch "/tmp/digests/chrome/${chrome_digest#sha256:}"
echo "chrome-image=hsac/fitnesse-fixtures-test-jre11-chrome@${chrome_digest}" >> $GITHUB_OUTPUT
mkdir -p /tmp/digests/test-with-pdf
test_with_pdf_digest="${{ fromJSON(steps.bake.outputs.metadata)['test-with-pdf']['containerimage.digest'] }}"
touch "/tmp/digests/test-with-pdf/${test_with_pdf_digest#sha256:}"
echo "test-with-pdf-image=hsac/fitnesse-fixtures-test-jre11-with-pdf@${test_with_pdf_digest}" >> $GITHUB_OUTPUT
mkdir -p /tmp/digests/chrome-with-pdf
chrome_with_pdf_digest="${{ fromJSON(steps.bake.outputs.metadata)['chrome-with-pdf']['containerimage.digest'] }}"
touch "/tmp/digests/chrome-with-pdf/${chrome_with_pdf_digest#sha256:}"
echo "chrome-with-pdf-image=hsac/fitnesse-fixtures-test-jre11-chrome-with-pdf@${chrome_with_pdf_digest}" >> $GITHUB_OUTPUT
- name: Upload digest
uses: actions/upload-artifact@v3
with:
name: digests
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
- name: Test test image
if: matrix.platform == 'linux/amd64'
run: |
mkdir -p target/failsafe-reports
mkdir -p target/fitnesse-results/test
mkdir -p target/fitnesse-results/test-rerun
docker run --rm \
-v "$(pwd)"/target/failsafe-reports:/fitnesse/target/failsafe-reports \
-v "$(pwd)"/target/fitnesse-results/test:/fitnesse/target/fitnesse-results \
-v "$(pwd)"/target/fitnesse-results/test-rerun:/fitnesse/target/fitnesse-rerun-results \
-v "$(pwd)"/src/test/wiki:/fitnesse/wiki/FitNesseRoot \
-e RE_RUN_FAILED=true \
${{ steps.digests.outputs.test-image }} \
-DfitnesseSuiteToRun=SampleTests.SlimTests.UtilityFixtures
- name: Test chrome image
if: matrix.platform == 'linux/amd64'
run: |
mkdir -p target/failsafe-reports
mkdir -p target/fitnesse-results/chrome
mkdir -p target/fitnesse-results/chrome-rerun
mkdir -p target/selenium-log
docker run --rm \
-v "$(pwd)"/target/failsafe-reports:/fitnesse/target/failsafe-reports \
-v "$(pwd)"/target/fitnesse-results/chrome:/fitnesse/target/fitnesse-results \
-v "$(pwd)"/target/fitnesse-results/chrome-rerun:/fitnesse/target/fitnesse-rerun-results \
-v "$(pwd)"/target/selenium-log:/fitnesse/target/selenium-log \
-v "$(pwd)"/src/test/wiki:/fitnesse/wiki/FitNesseRoot \
-e CHANGE_FITNESSE_DIRECTOY_OWNER=true \
-e RE_RUN_FAILED=true \
${{ steps.digests.outputs.chrome-image }} \
-DfitnesseSuiteToRun=SampleTests.SlimTests.BrowserTest
- name: Test pdf image
if: matrix.platform == 'linux/amd64'
run: |
mkdir -p target/failsafe-reports
mkdir -p target/fitnesse-results/test-with-pdf
mkdir -p target/fitnesse-results/test-with-pdf-rerun
docker run --rm \
-v "$(pwd)"/target/failsafe-reports:/fitnesse/target/failsafe-reports \
-v "$(pwd)"/target/fitnesse-results/test-with-pdf:/fitnesse/target/fitnesse-results \
-v "$(pwd)"/target/fitnesse-results/test-with-pdf-rerun:/fitnesse/target/fitnesse-rerun-results \
-v "$(pwd)"/src/test/wiki:/fitnesse/wiki/FitNesseRoot \
-e RE_RUN_FAILED=true \
${{ steps.digests.outputs.test-with-pdf-image }} \
-DfitnesseSuiteToRun=SampleTests.SlimTests.PdfTest
- name: Test combine image
if: matrix.platform == 'linux/amd64'
run: |
docker run --rm \
-v "$(pwd)"/target/fitnesse-results:/fitnesse/target/fitnesse-results \
${{ steps.digests.outputs.combine-image }}
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: docker-tests-results
path: target
merge:
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: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests/${{ matrix.target }}
run: |
docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ matrix.image }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \
$(printf '${{ matrix.image }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ matrix.image }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)