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