|
1 | 1 | name: Tests |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches: |
5 | | - - 'master' |
6 | 6 | - 'main' |
7 | | - - 'release-' |
8 | 7 | tags: '*' |
9 | 8 | paths-ignore: |
10 | 9 | - 'docs/**' |
|
14 | 13 |
|
15 | 14 | concurrency: |
16 | 15 | group: ${{ github.workflow }}-${{ github.ref }} |
17 | | - # Cancel intermediate builds: only if it is a pull request build. |
18 | 16 | cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} |
19 | | -jobs: |
20 | | - setup-matrix: |
21 | | - runs-on: ubuntu-latest |
22 | | - outputs: |
23 | | - groups: ${{ steps.mk.outputs.groups }} |
24 | | - version: ${{ steps.mk.outputs.version }} |
25 | | - os: ${{ steps.mk.outputs.os }} |
26 | | - steps: |
27 | | - - uses: actions/checkout@v6 |
28 | | - - id: mk |
29 | | - shell: bash |
30 | | - run: | |
31 | | - # Auto-discover test groups from all subdirectory names. |
32 | | - groups=$(find test -mindepth 1 -maxdepth 1 -type d \ |
33 | | - | xargs -I{} basename {} | sort \ |
34 | | - | jq -R -s -c '[split("\n")[] | select(length > 0) | select(.!= "testsuite")]') |
35 | | -
|
36 | | - echo "groups=${groups}" >> "$GITHUB_OUTPUT" |
37 | 17 |
|
38 | | - # Draft PR: only run ubuntu-latest + version=1 |
39 | | - if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.draft }}" == "true" ]]; then |
40 | | - echo 'version=["1"]' >> "$GITHUB_OUTPUT" |
41 | | - echo 'os=["ubuntu-latest"]' >> "$GITHUB_OUTPUT" |
42 | | - else |
43 | | - echo 'version=["min","1"]' >> "$GITHUB_OUTPUT" |
44 | | - echo 'os=["ubuntu-latest","macOS-latest","windows-latest"]' >> "$GITHUB_OUTPUT" |
45 | | - fi |
46 | | -
|
47 | | - test: |
48 | | - name: "Tests (${{ matrix.group }}, ${{ matrix.os }}, Julia ${{ matrix.version }})" |
49 | | - needs: setup-matrix |
50 | | - strategy: |
51 | | - fail-fast: false |
52 | | - matrix: |
53 | | - version: ${{ fromJSON(needs.setup-matrix.outputs.version) }} |
54 | | - os: ${{ fromJSON(needs.setup-matrix.outputs.os) }} |
55 | | - group: ${{ fromJSON(needs.setup-matrix.outputs.groups) }} |
56 | | - exclude: |
57 | | - - os: macos-latest |
58 | | - version: 1 |
59 | | - group: enzyme |
60 | | - - os: macos-latest |
61 | | - version: "min" |
62 | | - group: enzyme |
63 | | - runs-on: ${{ matrix.os }} |
64 | | - timeout-minutes: 120 |
65 | | - steps: |
66 | | - - uses: actions/checkout@v6 |
67 | | - - uses: julia-actions/setup-julia@v3 |
68 | | - with: |
69 | | - version: ${{ matrix.version }} |
70 | | - - uses: julia-actions/cache@v3 |
71 | | - - uses: julia-actions/julia-buildpkg@v1 |
72 | | - - uses: julia-actions/julia-runtest@v1 |
73 | | - with: |
74 | | - test_args: '${{ matrix.group }}${{ github.event.pull_request.draft == true && '' --fast'' || '''' }}' |
75 | | - env: |
76 | | - JULIA_NUM_THREADS: "4" |
77 | | - - uses: julia-actions/julia-processcoverage@v1 |
78 | | - with: |
79 | | - directories: 'src,ext' |
80 | | - - uses: codecov/codecov-action@v6 |
81 | | - with: |
82 | | - files: lcov.info |
83 | | - token: ${{ secrets.CODECOV_TOKEN }} |
84 | | - fail_ci_if_error: false |
| 18 | +jobs: |
| 19 | + tests: |
| 20 | + uses: "QuantumKitHub/QuantumKitHubActions/.github/workflows/TestGroups.yml@main" |
| 21 | + with: |
| 22 | + - fast: ${{ github.event.pull_request.draft == true }} |
| 23 | + - exclude: ["testsuite"] |
| 24 | + secrets: |
| 25 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments