Bump actions/setup-java from 3 to 4 #375
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build artifacts and test Docker image | |
on: | |
push: | |
pull_request: | |
branches: | |
- develop | |
- main | |
jobs: | |
xar: | |
name: Build the MerMEId xar package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# fetch all history to include latest tag for the git revision info | |
fetch-depth: 0 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- name: Build with Ant | |
run: ant clean xar | |
- name: Archive xar package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: xar-package | |
path: build/*.xar | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' | |
with: | |
prerelease: true | |
files: | | |
build/*.xar | |
docker: | |
name: Build and test the Docker image | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- EXISTDB_IMAGE: duncdrum/existdb:6.0.1 | |
IMAGE_TAG_SUFFIX: | |
PLATFORMS: | | |
linux/amd64 | |
linux/arm64 | |
- EXISTDB_IMAGE: acdhch/existdb:6.0.1-java11-ShenGC | |
IMAGE_TAG_SUFFIX: -java11-ShenGC | |
PLATFORMS: | | |
linux/amd64 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
# fetch all history to include latest tag for the git revision info | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to GitHub Container registry | |
uses: docker/login-action@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
registry: ghcr.io | |
username: vifebot | |
password: ${{ secrets.VIFEBOTS_GITHUB_TOKEN }} | |
- name: Log in to DockerHub | |
uses: docker/login-action@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
username: vifebot | |
password: ${{ secrets.VIFEBOT_DOCKERHUB_TOKEN }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/edirom/mermeid | |
edirom/mermeid | |
flavor: | | |
latest=${{ github.ref == 'refs/heads/main' }} | |
suffix=${{ matrix.IMAGE_TAG_SUFFIX }},onlatest=true | |
# Build without pushing | |
# subsequent steps will use this image from cache | |
# see https://github.com/docker/build-push-action/blob/master/docs/advanced/test-before-push.md | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
load: true | |
build-args: | | |
EXISTDB_IMAGE=${{ matrix.EXISTDB_IMAGE }} | |
tags: ${{ steps.meta.outputs.tags }} | |
- name: Run the Docker image | |
run: docker run --rm -p 8080:8080 -d ${{ fromJSON(steps.meta.outputs.json).tags[0] }} | |
- name: Check the deployed service URL | |
run: i=0 ; while (! curl --fail -sv http://localhost:8080/index.html) ; do if ((i > 20)) ; then echo ' **** timeout ... aborting **** ' ; exit 1 ; else sleep 5 ; echo waiting for container ... ; i=$((i+1)) ; fi ; done | |
- name: Run the maven tests | |
run: | | |
cd testing | |
mvn test | |
# Build and push Docker image with Buildx (don't push on PR) | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
if: github.event_name != 'pull_request' | |
with: | |
context: . | |
platforms: ${{ matrix.PLATFORMS }} | |
build-args: | | |
EXISTDB_IMAGE=${{ matrix.EXISTDB_IMAGE }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |