Skip to content

Test Build

Test Build #23

Workflow file for this run

name: Test Build
on:
workflow_dispatch:
release:
types: [released]
push:
branches:
- "main"
schedule:
- cron: '12 6 3 * *'
jobs:
build:
strategy:
matrix:
containers:
- file: files/Dockerfile
tags: |
simonkowallik/irulescan:latest
ghcr.io/simonkowallik/irulescan:latest
- file: files/Dockerfile.apiserver
tags: |
simonkowallik/irulescan:apiserver
ghcr.io/simonkowallik/irulescan:apiserver
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build container image
uses: docker/build-push-action@v3
with:
context: .
file: ${{ matrix.containers.file }}
platforms: linux/amd64
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ matrix.containers.tags }}
- name: Run container tests
if: ${{ matrix.containers.file == 'files/Dockerfile' }}
run: |
docker run --rm -v ${PWD}:/scandir \
simonkowallik/irulescan:latest /scandir/tests/test.sh
- name: Run apiserver tests
if: ${{ matrix.containers.file == 'files/Dockerfile.apiserver' }}
run: |
docker run --rm \
-v ${PWD}/tests/test.sh:/test-apiserver.sh \
-v ${PWD}/tests/test.sh:/entrypoint.sh \
--entrypoint /entrypoint.sh \
-v ${PWD}/tests:/tests \
simonkowallik/irulescan:apiserver /test-apiserver.sh