Skip to content

Commit

Permalink
generate matrix step
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamGallagher737 committed Jul 11, 2024
1 parent c470a6f commit e9c5450
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/tools-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e9c5450

Please sign in to comment.