bump actions/upload-artifact and actions/download-artifact to 4 #386
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: e2e | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'v*' | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
env: | |
BUILD_TAG: 'swarm-cronjob:local' | |
SERVICE_NAME: 'swarm-cronjob' | |
RUNNING_TIMEOUT: '120' | |
RUNNING_LOG_CHECK: 'Number of cronjob tasks: 7' | |
jobs: | |
e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Build | |
uses: docker/bake-action@v4 | |
with: | |
targets: image-local | |
- | |
name: Swarm init | |
run: | | |
docker swarm leave --force > /dev/null 2>&1 || true | |
docker swarm init --advertise-addr $(dig +short myip.opendns.com @resolver1.opendns.com) | |
- | |
name: Swarm deploy stacks | |
run: | | |
docker stack deploy date -c test/date.yml | |
docker stack deploy sleep -c test/sleep.yml | |
docker stack deploy error -c test/error.yml | |
docker stack deploy configs -c test/configs.yml | |
docker stack deploy global -c test/global.yml | |
docker stack deploy more_replicas -c test/more_replicas.yml | |
docker stack deploy query -c test/query.yml | |
- | |
name: Create service | |
run: | | |
docker service create --name ${{ env.SERVICE_NAME }} \ | |
--mount type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock \ | |
--env "LOG_LEVEL=debug" \ | |
--env "LOG_JSON=false" \ | |
--constraint 'node.role == manager' \ | |
${{ env.BUILD_TAG }} | |
- | |
name: Test service | |
run: | | |
TIMEOUT=$((SECONDS + ${{ env.RUNNING_TIMEOUT }})) | |
while read LOGLINE; do | |
echo ${LOGLINE} | |
if [[ ${LOGLINE} == *"${{ env.RUNNING_LOG_CHECK }}"* ]]; then | |
echo "🎉 Service up!" | |
break | |
fi | |
if [[ $SECONDS -gt ${TIMEOUT} ]]; then | |
>&2 echo "❌ Failed to run ${{ env.SERVICE_NAME }} service" | |
docker swarm leave --force > /dev/null 2>&1 || true | |
exit 1 | |
fi | |
done < <(docker service logs -f ${{ env.SERVICE_NAME }} 2>&1) | |
docker swarm leave --force > /dev/null 2>&1 || true |