Skip to content

Commit

Permalink
Load matrix from file
Browse files Browse the repository at this point in the history
  • Loading branch information
djperrefort committed Oct 30, 2024
1 parent 5d05f2f commit 698b27a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/Matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,14 @@ jobs:
runs-on: ubuntu-latest

outputs:
matrix: ${{ steps.create-matrix.outputs.matrix }}
matrix: ${{ steps.load-matrix.outputs.matrix }}

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Create build matrix
id: create-matrix
run: |
# List subdirectories under configs/
dirs=$(find configs -maxdepth 1 -type d -not -path 'configs' -exec basename {} \;)
echo "Config directories found:"
echo "$dirs"
# Convert to JSON array
dirs_json=$(jq -R -s 'split("\n") | map(select(length > 0))' <<< "$dirs")
echo "versions=$dirs_json" >> "$GITHUB_OUTPUT"
- name: Load matrix
id: load-matrix
uses: zoexx/github-action-json-file-properties@release
with:
file_path: "slurm_config/matrix.json"
11 changes: 11 additions & 0 deletions configs/matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"matrix": {
"include": [
{
"version": [
"23.02.5"
]
}
]
}
}

0 comments on commit 698b27a

Please sign in to comment.