Skip to content

Commit

Permalink
Remove images after testing (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKobayashi authored Sep 28, 2024
1 parent 5782b03 commit bd32f08
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
secrets: inherit
strategy:
fail-fast: false
max-parallel: 4
matrix:
runner-name: [
actions-runner,
Expand Down Expand Up @@ -54,6 +55,7 @@ jobs:
needs: [create-runners, build-setup]
strategy:
fail-fast: false
max-parallel: 4
matrix:
container: [
actions-runner,
Expand Down
70 changes: 65 additions & 5 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
secrets: inherit
strategy:
fail-fast: false
max-parallel: 4
matrix:
runner-name: [
actions-runner,
Expand All @@ -27,7 +28,7 @@ jobs:
speedtest,
stun,
telegraf,
# verlihub,
verlihub,
vyos-release-alert,
xteve,
yancobat
Expand All @@ -49,6 +50,7 @@ jobs:
needs: [create-runners, build-setup]
strategy:
fail-fast: false
max-parallel: 2
matrix:
container: [
actions-runner,
Expand All @@ -58,13 +60,12 @@ jobs:
growatt-ev,
iperf2,
iperf3,
irrd,
mdns-reflector,
rng-tools,
speedtest,
stun,
telegraf,
# verlihub,
verlihub,
vyos-release-alert,
xteve,
yancobat
Expand Down Expand Up @@ -101,5 +102,64 @@ jobs:
# Test the built image
- name: Test image
run: |
set -ex
timeout --kill-after=30s --preserve-status 30s docker container run --rm ${{ needs.build-setup.outputs.repo-owner }}/${{ matrix.container }}:test
set -x
timeout --kill-after=30s --preserve-status 30s \
docker container run --attach stdout --attach stderr --init --rm ${{ needs.build-setup.outputs.repo-owner }}/${{ matrix.container }}:test
# Remove the test image
- name: Remove test image
if: ${{ !cancelled() }}
run: |
set -x
docker image rm ${{ needs.build-setup.outputs.repo-owner }}/${{ matrix.container }}:test
build-test-noinit:
name: Build and test image without `--init`
runs-on: self-hosted
needs: [create-runners, build-setup]
strategy:
fail-fast: false
max-parallel: 2
matrix:
container: [
irrd
]
steps:
# Checkout repository
# https://github.com/actions/checkout
- name: Checkout repository
uses: actions/[email protected]
# Set up QEMU
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/[email protected]
# Set up Docker Buildx
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/[email protected]
with:
buildkitd-config-inline: |
[registry."docker.io"]
mirrors = ["registry-mirror:5000"]
[registry."registry-mirror:5000"]
http = true
driver-opts: |
network=mattflix
# Build and export image to Docker daemon
# https://github.com/docker/build-push-action
- name: Build and export to Docker
uses: docker/[email protected]
with:
context: ${{ matrix.container }}
load: true
tags: "${{ needs.build-setup.outputs.repo-owner }}/${{ matrix.container }}:test"
# Test the built image
- name: Test image
run: |
set -x
timeout --kill-after=30s --preserve-status 30s \
docker container run --attach stdout --attach stderr --rm ${{ needs.build-setup.outputs.repo-owner }}/${{ matrix.container }}:test
# Remove the test image
- name: Remove test image
if: ${{ !cancelled() }}
run: |
set -x
docker image rm ${{ needs.build-setup.outputs.repo-owner }}/${{ matrix.container }}:test

0 comments on commit bd32f08

Please sign in to comment.