From e9c54502e6a3ac2474e8e7b42e23e8440d50ff8e Mon Sep 17 00:00:00 2001 From: Liam Gallagher Date: Fri, 12 Jul 2024 10:05:27 +1200 Subject: [PATCH] generate matrix step --- .github/workflows/tools-ci.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tools-ci.yml b/.github/workflows/tools-ci.yml index f593d120..08e4cf21 100644 --- a/.github/workflows/tools-ci.yml +++ b/.github/workflows/tools-ci.yml @@ -16,13 +16,28 @@ env: CARGO_TERM_COLOR: always jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Generate matrix + id: set-matrix + run: | + tools=$(ls tools) + tools_json=$(echo $tools | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "::set-output name=matrix::${tools_json}" + # Run cargo test test: name: Runs Tests runs-on: ubuntu-latest strategy: matrix: - tool: [$(ls tools)] + tool: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} timeout-minutes: 30 steps: - name: Checkout sources @@ -49,7 +64,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - tool: [$(ls tools)] + tool: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} timeout-minutes: 30 steps: - name: Checkout sources @@ -78,7 +93,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - tool: [$(ls tools)] + tool: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} timeout-minutes: 30 steps: - name: Checkout sources