build(deps): bump docker/build-push-action from 6.17.0 to 6.18.0 #561
Workflow file for this run
This file contains hidden or 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: Test Docker image | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: [8, 11, 17, 21] | |
java-type: [jdk, jre] | |
node-version: [20, 22] | |
variant: [default, alpine] | |
steps: | |
- uses: actions/checkout@v4.2.2 | |
- name: Build and test Docker image | |
run: | | |
VARIANT_PATH="${{ matrix.variant == 'alpine' && '/alpine' || '' }}" | |
IMAGE_PATH="${{ matrix.java-version }}/${{ matrix.java-type }}/${{ matrix.node-version }}${VARIANT_PATH}" | |
VARIANT_LABEL="${{ matrix.variant == 'alpine' && ' alpine' || '' }}" | |
JAVA_TYPE=$(echo "${{ matrix.java-type }}" | tr '[:lower:]' '[:upper:]') | |
printf "\n\n${JAVA_TYPE}${{ matrix.java-version }} with Node.js ${{ matrix.node-version }}${VARIANT_LABEL}\n" | |
# Run container and capture version outputs | |
VERSIONS=$(docker run -i $(docker build -q ${IMAGE_PATH}) /bin/sh -c "java -version 2>&1 && node --version") | |
echo "$VERSIONS" | |
# Check Java version | |
if [ "${{ matrix.java-version }}" = "8" ]; then | |
if ! echo "$VERSIONS" | grep -q "version \"1.8.0"; then | |
echo "::error::Expected Java 8 but got different version" | |
exit 1 | |
fi | |
else | |
if ! echo "$VERSIONS" | grep -q "version \"${{ matrix.java-version }}"; then | |
echo "::error::Expected Java ${{ matrix.java-version }} but got different version" | |
exit 1 | |
fi | |
fi | |
# Check Node version | |
if ! echo "$VERSIONS" | grep -q "v${{ matrix.node-version }}"; then | |
echo "::error::Expected Node.js ${{ matrix.node-version }} but got different version" | |
exit 1 | |
fi | |
auto-merge: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Automatically merge dependabot upgrades | |
uses: fastify/github-action-merge-dependabot@v3.11.1 | |
with: | |
target: minor |