matrix-docker-test #17
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: matrix-docker-test | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Image tag of hyperledger/besu' | |
required: true | |
default: '24.5.4' | |
jobs: | |
verify: | |
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 $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 stop ${{ env.CONTAINER_NAME }} > /dev/null | |
if [[ $success != "true" ]] | |
then | |
docker ps -a | |
docker logs ${{ env.CONTAINER_NAME }} | |
echo "::error Could not find the log message 'Ethereum main loop is up'" | |
exit 1 | |
fi | |
exit 0 | |
env: | |
SLEEP: 5 | |
RETRY: 10 | |