Merge pull request #2622 from signalwire/unittests
[GHA] Use autogenerated matrix for grouping unit-tests.
This commit is contained in:
commit
97cb6722ae
|
@ -10,20 +10,31 @@ on:
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests_1:
|
unit-tests-pre-config:
|
||||||
name: "unit-tests (group 1)"
|
runs-on: ubuntu-latest
|
||||||
uses: ./.github/workflows/unit-test.yml
|
env:
|
||||||
with:
|
TOTAL_GROUPS: 2
|
||||||
total-groups: 2
|
outputs:
|
||||||
current-group: 1
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
secrets: inherit
|
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:
|
unit-tests:
|
||||||
name: "unit-tests (group 2)"
|
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
|
uses: ./.github/workflows/unit-test.yml
|
||||||
with:
|
with:
|
||||||
total-groups: 2
|
total-groups: ${{ matrix.total }}
|
||||||
current-group: 2
|
current-group: ${{ matrix.group }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
scan-build:
|
scan-build:
|
||||||
|
|
|
@ -13,7 +13,7 @@ on:
|
||||||
type: number
|
type: number
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
unit-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: signalwire/freeswitch-public-base:bookworm
|
image: signalwire/freeswitch-public-base:bookworm
|
||||||
|
|
Loading…
Reference in New Issue