Skip to content

matrix-docker-test

matrix-docker-test #13

name: matrix-docker-test
on:
workflow_dispatch:
inputs:
tag:
description: 'Image tag of hyperledger/besu'
required: true
default: '24.5.4'
jobs:
test:
strategy:
matrix:
combination:
- tag: ${{ inputs.tag }}
platform: ''
runner: ubuntu-latest
- tag: ${{ inputs.tag }}-arm64
platform: 'linux/arm64'
runner: ubuntu-latest
- tag: latest
platform: ''
runner: ubuntu-latest
- tag: ${{ inputs.tag }}-amd64
platform: ''
runner: ubuntu-latest
runs-on: ${{ matrix.combination.runner }}
env:
CONTAINER_NAME: besu-check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start container
run: |
PLATFORM_OPT=""
[[ x${{ matrix.combination.platform }} != 'x' ]] && PLATFORM_OPT="--platform ${{ matrix.combination.platform }}"
docker run -d --rm $PLATFORM_OPT --name ${{ env.CONTAINER_NAME }} hyperledger/besu:${{ matrix.combination.tag }}
- name: Verify besu container
run: |
success=false
while [[ $success != "true" && $RETRY -gt 0 ]]
do
docker logs ${{ env.CONTAINER_NAME }} | grep -q "Ethereum main loop is up" && success=true
RETRY=$(expr $RETRY - 1)
echo "Waiting for the container to start. Remaining retries $RETRY ..."
sleep $SLEEP
done
docker rm -f ${{ env.CONTAINER_NAME }} > /dev/null
if [[ $success != "true" ]]do
then
echo "Could not find the log message 'Ethereum main loop is up'"
exit 1
fi
exit 0
env:
SLEEP: 5
RETRY: 10