Skip to content

Commit 3b65398

Browse files
authored
Update test workflow (#222)
* update test workflow * Shorter action names * support fast tests * increase time-out
1 parent 56be3ce commit 3b65398

11 files changed

Lines changed: 82 additions & 90 deletions

File tree

.github/workflows/Tests.yml

Lines changed: 12 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
name: Tests
1+
name: CI
2+
23
on:
34
push:
45
branches:
5-
- 'master'
66
- 'main'
7-
- 'release-'
87
tags: '*'
98
paths-ignore:
109
- 'docs/**'
@@ -14,71 +13,15 @@ on:
1413

1514
concurrency:
1615
group: ${{ github.workflow }}-${{ github.ref }}
17-
# Cancel intermediate builds: only if it is a pull request build.
1816
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"
3717

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+
name: "Tests"
21+
uses: "QuantumKitHub/QuantumKitHubActions/.github/workflows/TestGroups.yml@main"
22+
with:
23+
fast: "${{ github.event.pull_request.draft == true }}"
24+
exclude: '["testsuite"]'
25+
timeout-minutes: 120
26+
secrets:
27+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test/decompositions/eig.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ using LinearAlgebra: Diagonal
66
using MatrixAlgebraKit: TruncatedAlgorithm, diagview, norm, GS
77
using CUDA, AMDGPU
88

9-
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
10-
GenericFloats = (BigFloat, Complex{BigFloat})
9+
if @isdefined(fast_tests) && fast_tests
10+
BLASFloats = (Float64, ComplexF64)
11+
GenericFloats = (BigFloat, Complex{BigFloat})
12+
else
13+
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
14+
GenericFloats = (BigFloat, Complex{BigFloat})
15+
end
1116

1217
@isdefined(TestSuite) || include("../testsuite/TestSuite.jl")
1318
using .TestSuite

test/decompositions/eigh.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ using StableRNGs
55
using LinearAlgebra: LinearAlgebra, Diagonal, I
66
using CUDA, AMDGPU
77

8-
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
9-
GenericFloats = (BigFloat, Complex{BigFloat})
8+
if @isdefined(fast_tests) && fast_tests
9+
BLASFloats = (Float64, ComplexF64)
10+
GenericFloats = (BigFloat, Complex{BigFloat})
11+
else
12+
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
13+
GenericFloats = (BigFloat, Complex{BigFloat})
14+
end
1015

1116
@isdefined(TestSuite) || include("../testsuite/TestSuite.jl")
1217
using .TestSuite

test/decompositions/gen_eig.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ using TestExtras
44
using StableRNGs
55
using LinearAlgebra: Diagonal
66

7-
@testset "gen_eig_full! for T = $T" for T in (Float32, Float64, ComplexF32, ComplexF64)
7+
if @isdefined(fast_tests) && fast_tests
8+
BLASFloats = (Float64, ComplexF64)
9+
else
10+
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
11+
end
12+
13+
@testset "gen_eig_full! for T = $T" for T in BLASFloats
814
rng = StableRNG(123)
915
m = 54
1016
for alg in (LAPACK_Simple(), :LAPACK_Simple, LAPACK_Simple)

test/decompositions/lq.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ using LinearAlgebra: diag, I, Diagonal
66
using MatrixAlgebraKit: LQViaTransposedQR, LAPACK_HouseholderLQ
77
using CUDA, AMDGPU, GenericLinearAlgebra
88

9-
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
10-
GenericFloats = (Float16, BigFloat, Complex{BigFloat})
9+
if @isdefined(fast_tests) && fast_tests
10+
BLASFloats = (Float64, ComplexF64)
11+
GenericFloats = (Float16, Complex{BigFloat})
12+
else
13+
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
14+
GenericFloats = (Float16, BigFloat, Complex{BigFloat})
15+
end
1116

1217
@isdefined(TestSuite) || include("../testsuite/TestSuite.jl")
1318
using .TestSuite

test/decompositions/orthnull.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ using StableRNGs
55
using LinearAlgebra: LinearAlgebra, I, Diagonal
66
using CUDA, AMDGPU
77

8-
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
9-
GenericFloats = (BigFloat, Complex{BigFloat})
8+
if @isdefined(fast_tests) && fast_tests
9+
BLASFloats = (Float64, ComplexF64)
10+
GenericFloats = (BigFloat, Complex{BigFloat})
11+
else
12+
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
13+
GenericFloats = (BigFloat, Complex{BigFloat})
14+
end
1015

1116
@isdefined(TestSuite) || include("../testsuite/TestSuite.jl")
1217
using .TestSuite

test/decompositions/polar.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ using StableRNGs
44
using LinearAlgebra: Diagonal, LAPACK
55
using CUDA, AMDGPU
66

7-
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
8-
GenericFloats = (BigFloat, Complex{BigFloat})
7+
if @isdefined(fast_tests) && fast_tests
8+
BLASFloats = (Float64, ComplexF64)
9+
GenericFloats = (BigFloat, Complex{BigFloat})
10+
else
11+
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
12+
GenericFloats = (BigFloat, Complex{BigFloat})
13+
end
914

1015
@isdefined(TestSuite) || include("../testsuite/TestSuite.jl")
1116
using .TestSuite

test/decompositions/qr.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ using StableRNGs
55
using LinearAlgebra: diag, I, Diagonal
66
using CUDA, AMDGPU, GenericLinearAlgebra
77

8-
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
9-
GenericFloats = (Float16, BigFloat, Complex{BigFloat})
8+
if @isdefined(fast_tests) && fast_tests
9+
BLASFloats = (Float64, ComplexF64)
10+
GenericFloats = (Float16, Complex{BigFloat})
11+
else
12+
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
13+
GenericFloats = (Float16, BigFloat, Complex{BigFloat})
14+
end
1015

1116
@isdefined(TestSuite) || include("../testsuite/TestSuite.jl")
1217
using .TestSuite

test/decompositions/schur.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ using TestExtras
44
using StableRNGs
55
using LinearAlgebra: I, Diagonal
66

7-
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
8-
GenericFloats = (BigFloat, Complex{BigFloat})
7+
if @isdefined(fast_tests) && fast_tests
8+
BLASFloats = (Float64, ComplexF64)
9+
GenericFloats = (BigFloat, Complex{BigFloat})
10+
else
11+
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
12+
GenericFloats = (BigFloat, Complex{BigFloat})
13+
end
914

1015
@isdefined(TestSuite) || include("../testsuite/TestSuite.jl")
1116
using .TestSuite

test/decompositions/svd.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ using MatrixAlgebraKit
22
using LinearAlgebra: Diagonal
33
using CUDA, AMDGPU
44

5-
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
6-
GenericFloats = (BigFloat, Complex{BigFloat})
5+
if @isdefined(fast_tests) && fast_tests
6+
BLASFloats = (Float64, ComplexF64)
7+
GenericFloats = (BigFloat, Complex{BigFloat})
8+
else
9+
BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
10+
GenericFloats = (BigFloat, Complex{BigFloat})
11+
end
712

813
@isdefined(TestSuite) || include("../testsuite/TestSuite.jl")
914
using .TestSuite

0 commit comments

Comments
 (0)