Skip to content

Commit

Permalink
Merge pull request #2622 from signalwire/unittests
Browse files Browse the repository at this point in the history
[GHA] Use autogenerated matrix for grouping unit-tests.
  • Loading branch information
andywolk authored Oct 15, 2024
2 parents 9599739 + b662cc7 commit 97cb672
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,31 @@ on:
- synchronize

jobs:
unit-tests_1:
name: "unit-tests (group 1)"
uses: ./.github/workflows/unit-test.yml
with:
total-groups: 2
current-group: 1
secrets: inherit
unit-tests-pre-config:
runs-on: ubuntu-latest
env:
TOTAL_GROUPS: 2
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
shell: bash
run: |
MATRIX=$(jq -c -n --argjson groups "${{ env.TOTAL_GROUPS }}" \
'{
include: [range(1; $groups + 1) | {group: ., total: $groups}]
}')
echo "matrix=$MATRIX" | tee -a $GITHUB_OUTPUT
unit-tests_2:
name: "unit-tests (group 2)"
unit-tests:
needs: unit-tests-pre-config
strategy:
matrix: ${{ fromJson(needs.unit-tests-pre-config.outputs.matrix) }}
name: "unit-tests (group ${{ matrix.group }})"
uses: ./.github/workflows/unit-test.yml
with:
total-groups: 2
current-group: 2
total-groups: ${{ matrix.total }}
current-group: ${{ matrix.group }}
secrets: inherit

scan-build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: number

jobs:
unit-tests:
unit-test:
runs-on: ubuntu-latest
container:
image: signalwire/freeswitch-public-base:bookworm
Expand Down

0 comments on commit 97cb672

Please sign in to comment.