Skip to content

Commit

Permalink
ci(github): isolate container test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Feb 7, 2025
1 parent 989723a commit 8e08fce
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Container Tests

on:
workflow_call:

jobs:
integration_test:
name: 🚥 Container test
needs:
- Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker pull ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: 🚥 Run Container Tests
uses: docker://gcr.io/gcp-runtimes/container-structure-test:v1.15.0
with:
args: test --config container-structure-test.yml --image ghcr.io/${{ github.repository }}:${{ github.sha }} --verbosity debug
15 changes: 1 addition & 14 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Docker Image

on:
push:
workflow_call:

jobs:
build:
Expand Down Expand Up @@ -41,16 +41,3 @@ jobs:
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
build-args: |
SOURCE_COMMIT=${{ github.sha }}
integration_test:
name: 🚥 Integration test
needs:
- Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker pull ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: 🚥 Run Container Tests
uses: docker://gcr.io/gcp-runtimes/container-structure-test:v1.15.0
with:
args: test --config container-structure-test.yml --image ghcr.io/${{ github.repository }}:${{ github.sha }} --verbosity debug
8 changes: 8 additions & 0 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ env:
HOST: http://172.18.0.1:3000
ZAMMAD_TOKEN: ${{ secrets.ZAMMAD_TOKEN }}
jobs:
build:
uses: ./.github/workflows/docker.yml

container-tests:
needs: build
uses: ./.github/workflows/container.yml

test:
needs: build
strategy:
# don't fail the entire matrix on failure
fail-fast: false
Expand Down

0 comments on commit 8e08fce

Please sign in to comment.