From 44c8b66d0cdd62a698c01e6263bd2e1ae95df6ba Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Sun, 7 Jan 2024 00:23:11 +0100 Subject: [PATCH] Testing overhaul --- .github/workflows/CI.yml | 25 ++++++++++++------------- .github/workflows/Documentation.yml | 3 ++- .github/workflows/Downgrade.yml | 18 +++++++++++++++--- Project.toml | 11 +++++++++++ test/Project.toml | 8 -------- test/basic.jl | 3 ++- test/cartesian.jl | 1 + test/more_generic.jl | 1 + test/runtests.jl | 12 +++++------- 9 files changed, 49 insertions(+), 33 deletions(-) delete mode 100644 test/Project.toml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e0d7a57..ac82079 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,36 +10,35 @@ on: - master paths-ignore: - 'docs/**' + schedule: + - cron: '57 0 * * 5' jobs: test: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: group: - Core version: - '1' + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} - - uses: actions/cache@v3 - env: - cache-name: cache-artifacts + - uses: julia-actions/cache@v1 with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + token: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - env: - GROUP: ${{ matrix.group }} - JULIA_NUM_THREADS: 11 + with: + depwarn: error - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v3 with: - file: lcov.info + file: lcov.info \ No newline at end of file diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 7b4b9ab..13cb45e 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -7,7 +7,8 @@ on: - 'release-' tags: '*' pull_request: - + schedule: + - cron: '28 12 * * 6' jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml index 01ff8ca..f4b99b4 100644 --- a/.github/workflows/Downgrade.yml +++ b/.github/workflows/Downgrade.yml @@ -10,20 +10,32 @@ on: - master paths-ignore: - 'docs/**' + schedule: + - cron: '28 12 * * 6' jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - version: ['1'] + group: + - Core + version: + - '1' + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} - uses: cjdoris/julia-downgrade-compat-action@v1 -# if: ${{ matrix.version == '1.6' }} with: skip: Pkg,TOML + - uses: julia-actions/cache@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 \ No newline at end of file diff --git a/Project.toml b/Project.toml index d1f9a65..23caf1a 100644 --- a/Project.toml +++ b/Project.toml @@ -7,5 +7,16 @@ version = "1.8.0" StaticArrayInterface = "0d7ed370-da01-4f52-bd93-41d350b8b718" [compat] +Aqua = "0.8" +SafeTestsets = "0.1" StaticArrayInterface = "1.2" +Test = "1" julia = "1.10" + +[extras] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Aqua", "Test", "SafeTestsets"] diff --git a/test/Project.toml b/test/Project.toml deleted file mode 100644 index cc78cbf..0000000 --- a/test/Project.toml +++ /dev/null @@ -1,8 +0,0 @@ -[deps] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" -StaticArrayInterface = "0d7ed370-da01-4f52-bd93-41d350b8b718" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[compat] -Aqua = "0.8" -StaticArrayInterface = "1" diff --git a/test/basic.jl b/test/basic.jl index 6d40056..e31aacc 100644 --- a/test/basic.jl +++ b/test/basic.jl @@ -1,4 +1,5 @@ - +using EllipsisNotation +using StaticArrayInterface @test isempty(detect_ambiguities(EllipsisNotation)) A = Array{Int}(undef, 2, 4, 2) diff --git a/test/cartesian.jl b/test/cartesian.jl index 246ebf8..5708c33 100644 --- a/test/cartesian.jl +++ b/test/cartesian.jl @@ -1,3 +1,4 @@ +using EllipsisNotation @testset "CartesianIndex" begin A = rand(4, 4, 4, 4, 4) @test A[.., 1, 2, 3] == A[.., CartesianIndex(1, 2, 3)] diff --git a/test/more_generic.jl b/test/more_generic.jl index 292e519..ebc4439 100644 --- a/test/more_generic.jl +++ b/test/more_generic.jl @@ -1,3 +1,4 @@ +using EllipsisNotation B = Array{Int}(undef, 2, 3, 4, 5, 6) n = 0 diff --git a/test/runtests.jl b/test/runtests.jl index 1a99924..e25b72a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,8 +1,6 @@ -using StaticArrayInterface -using EllipsisNotation -using Test +using SafeTestsets -include("qa.jl") -include("basic.jl") -include("more_generic.jl") -include("cartesian.jl") +@time @safetestset "Quality Assurance" include("qa.jl") +@time @safetestset "Basic Tests" include("basic.jl") +@time @safetestset "Generic Tests" include("more_generic.jl") +@time @safetestset "Cartesian Tests" include("cartesian.jl")