Simplify CI config file

This commit is contained in:
Harvester57
2025-08-30 14:40:47 +02:00
parent b58dfa2a20
commit 7a6bc139e4

View File

@@ -1,5 +1,4 @@
name: Build and test image name: Build, test and generate SBOM
on: on:
push: push:
branches: branches:
@@ -32,13 +31,11 @@ jobs:
matrix: matrix:
include: include:
- arch : amd64 - arch : amd64
mode : build-and-test
runner : ubuntu-24.04 runner : ubuntu-24.04
- arch : arm64 - arch : arm64
variant : v8 variant : v8
mode : build-and-test
runner : ubuntu-24.04-arm runner : ubuntu-24.04-arm
runs-on: ${{matrix.runner}} runs-on: ${{ matrix.runner }}
permissions: permissions:
contents: read contents: read
env: env:
@@ -69,7 +66,7 @@ jobs:
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with: with:
pull : true pull : true
load : ${{ matrix.mode == 'build-and-test' }} load : true
platforms : ${{ env.PLATFORM }} platforms : ${{ env.PLATFORM }}
context : . context : .
file : ./Dockerfile file : ./Dockerfile
@@ -78,20 +75,17 @@ jobs:
cache-to : type=gha,scope=${{ github.workflow }}:${{ env.PLATFORM }},mode=max cache-to : type=gha,scope=${{ github.workflow }}:${{ env.PLATFORM }},mode=max
- -
name: Import Luxembourg name: Import Luxembourg
if : ${{ matrix.mode == 'build-and-test' }}
run : | run : |
docker volume create ${VOLUME} docker volume create ${VOLUME}
docker run --rm --shm-size=4GB -v ${VOLUME}:${MOUNT} -e UPDATES=enabled ${{ env.IMAGE }}:testbuild-${{ matrix.arch }} import docker run --rm --shm-size=4GB -v ${VOLUME}:${MOUNT} -e UPDATES=enabled ${{ env.IMAGE }}:testbuild-${{ matrix.arch }} import
- -
name: Start server name: Start server
if : ${{ matrix.mode == 'build-and-test' }}
run : | run : |
docker run --shm-size=4GB -v ${VOLUME}:${MOUNT} -e UPDATES=enabled -p 80:80 -d --name ${CONTAINER} ${{ env.IMAGE }}:testbuild-${{ matrix.arch }} run docker run --shm-size=4GB -v ${VOLUME}:${MOUNT} -e UPDATES=enabled -p 80:80 -d --name ${CONTAINER} ${{ env.IMAGE }}:testbuild-${{ matrix.arch }} run
sleep 30 sleep 30
docker logs ${CONTAINER} docker logs ${CONTAINER}
- -
name: Download tiles name: Download tiles
if : ${{ matrix.mode == 'build-and-test' }}
run : | run : |
curl http://localhost/tile/0/0/0.png --fail -o 000.png curl http://localhost/tile/0/0/0.png --fail -o 000.png
curl http://localhost/tile/1/0/0.png --fail -o 100.png curl http://localhost/tile/1/0/0.png --fail -o 100.png
@@ -102,7 +96,6 @@ jobs:
curl http://localhost/tile/18/135536/89345.png --fail -o example.png curl http://localhost/tile/18/135536/89345.png --fail -o example.png
- -
name: Verify tiles name: Verify tiles
if : ${{ matrix.mode == 'build-and-test' }}
run : | run : |
sha1sum *.png sha1sum *.png
sha1sum --check <<EOF sha1sum --check <<EOF
@@ -123,7 +116,6 @@ jobs:
done done
- -
name: Cleanup name: Cleanup
if : ${{ matrix.mode == 'build-and-test' }}
run : | run : |
docker rm --force --volumes ${CONTAINER} docker rm --force --volumes ${CONTAINER}
docker volume rm --force ${VOLUME} docker volume rm --force ${VOLUME}