Skip to content

Commit a4acb72

Browse files
author
ddundo
committed
Simplify matrix condition
1 parent 4342078 commit a4acb72

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

.github/workflows/test_suite.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,15 @@ concurrency:
2626
cancel-in-progress: true
2727

2828
jobs:
29-
set-matrix:
30-
runs-on: ubuntu-latest
31-
outputs:
32-
matrix: ${{ steps.set-branches.outputs.matrix }}
33-
steps:
34-
# Set the matrix for the test_suite job. Use master and dev branches for scheduled runs
35-
# and the branch of the push event otherwise
36-
- id: set-branches
37-
run: |
38-
if [[ "${{ github.event_name }}" == "schedule" ]]; then
39-
echo "matrix={\"branch\":[\"master\",\"dev\"]}" >> $GITHUB_OUTPUT
40-
else
41-
echo "matrix={\"branch\":[\"${{ github.head_ref }}\"]}" >> $GITHUB_OUTPUT
42-
fi
43-
4429
test_suite:
4530
name: 'Test suite'
46-
needs: set-matrix
4731
runs-on: ubuntu-latest
4832

4933
strategy:
50-
matrix: ${{ fromJSON(needs.set-matrix.outputs.matrix) }}
34+
matrix:
35+
# Run the workflow on master and dev branches if triggered by a schedule event.
36+
# Otherwise, run the workflow on the source branch of the pull request.
37+
branch: ${{ github.event_name == 'schedule' && fromJSON('["master", "dev"]') || fromJSON('["' + github.head_ref + '"]') }}
5138
fail-fast: false
5239

5340
# Use pygem:latest for master branch and pygem:dev otherwise

0 commit comments

Comments
 (0)