From 121ee3904daaa5a54d2043b614cee95b2f48bf62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Kivim=C3=A4ki?= Date: Tue, 12 Nov 2024 10:09:09 +0200 Subject: [PATCH] ci: test example recipes before publishing --- .github/workflows/publish-examples.yml | 31 ++++++++++--------- .../files/.github/workflows/check.yml | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish-examples.yml b/.github/workflows/publish-examples.yml index ed5515c8..fc061acb 100644 --- a/.github/workflows/publish-examples.yml +++ b/.github/workflows/publish-examples.yml @@ -17,28 +17,31 @@ jobs: packages: write env: DOCKER_CONFIG: $HOME/.docker + strategy: + fail-fast: false + matrix: + recipe_name: + - github-action + - minimal + - terraform-bootstrap + - variable-file-names + - variable-types + - with-tests steps: - uses: actions/checkout@v4 + - uses: futurice/jalapeno@main + name: Test ${{ matrix.recipe_name }} + with: + cmd: test examples/${{ matrix.recipe_name }} + - uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # TODO: Loop over dynamically through all examples - - uses: futurice/jalapeno@main - with: - cmd: push ./examples/github-action oci://ghcr.io/futurice/jalapeno/examples/github-action - - uses: futurice/jalapeno@main - with: - cmd: push ./examples/minimal oci://ghcr.io/futurice/jalapeno/examples/minimal - - uses: futurice/jalapeno@main - with: - cmd: push ./examples/variable-types oci://ghcr.io/futurice/jalapeno/examples/variable-types - - uses: futurice/jalapeno@main - with: - cmd: push ./examples/with-tests oci://ghcr.io/futurice/jalapeno/examples/with-tests - uses: futurice/jalapeno@main + name: Push ${{ matrix.recipe_name }} with: - cmd: push ./examples/terraform-bootstrap oci://ghcr.io/futurice/jalapeno/examples/terraform-bootstrap + cmd: push examples/${{ matrix.recipe_name }} ghcr.io/futurice/jalapeno/examples/${{ matrix.recipe_name }} --latest diff --git a/examples/github-action/tests/defaults/files/.github/workflows/check.yml b/examples/github-action/tests/defaults/files/.github/workflows/check.yml index 2f780b7d..c0ecfe2f 100644 --- a/examples/github-action/tests/defaults/files/.github/workflows/check.yml +++ b/examples/github-action/tests/defaults/files/.github/workflows/check.yml @@ -21,6 +21,6 @@ jobs: - uses: futurice/jalapeno@main id: jalapeno with: - cmd: check + cmd: check --detailed-exitcode - if: steps.jalapeno.outputs.exit-code == '2' run: echo "::notice::Jalapeno updates available"