Nightly Test #892
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: Nightly Test | |
# Run the nightly tests at at 6 AM UTC | |
on: | |
schedule: | |
- cron: "0 6 * * *" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [linux/amd64, linux/arm64] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-build-x-${{ matrix.arch }}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-build-x-${{ matrix.arch }}- | |
- name: Build | |
uses: docker/[email protected] | |
with: | |
platforms: ${{ matrix.arch }} | |
context: ./app | |
file: ./app/Dockerfile | |
push: false | |
load: true | |
tags: oittaa/avif-converter:latest | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache-new | |
- | |
# Temp fix | |
# https://github.com/docker/build-push-action/issues/252 | |
# https://github.com/moby/buildkit/issues/1896 | |
name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
- name: Docker container up | |
run: docker run -d --rm -p 8080:8080 --env PORT=8080 --name avif-converter oittaa/avif-converter | |
- name: Wait 10 seconds | |
run: sleep 10 | |
- name: Check running containers | |
run: docker ps -a | |
- name: Check the container web page reachability | |
run: curl --output /dev/null -s --retry 10 --retry-connrefused http://localhost:8080/ | |
- name: Check the container API reachability | |
run: curl --output /dev/null -s -L -F "file=@test_images/test.png" http://localhost:8080/api | |
- name: Check Docker logs | |
run: docker logs avif-converter | |
- name: Docker container down | |
run: docker stop avif-converter |