From 08576e162cf39411a519acb6cf551afb40e295de Mon Sep 17 00:00:00 2001 From: Ruairidh MacLeod Date: Mon, 9 Dec 2024 10:37:57 +0000 Subject: [PATCH] add app matrix to CI --- .github/workflows/main.yaml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2c88a6d..7dcb58b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -10,9 +10,29 @@ defaults: run: shell: bash +env: + RUNS_ON: ubuntu-24.04 + jobs: + init: + runs-on: ${{ env.RUNS_ON }} + outputs: + apps: ${{ steps.apps.outputs.apps }} + steps: + - name: checkout + uses: actions/checkout@v4 + - name: set app matrix + id: apps + run: | + set -euxo pipefail + apps=$(find . -name Dockerfile | xargs dirname | cut -d'/' -f2 | sort | jq -ncR '[inputs]') + echo "apps=$apps" >> "$GITHUB_OUTPUT" build: - runs-on: ubuntu-24.04 + runs-on: ${{ env.RUNS_ON }} + needs: init + strategy: + matrix: + apps: ${{ fromJSON(needs.init.outputs.apps) }} steps: - name: Checkout repo uses: actions/checkout@v4