From 08c295f20b46348e5540f45ba806bbf3bcd62d64 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Mon, 4 Jul 2022 15:08:42 +0200 Subject: [PATCH 01/12] Implement nzvalview and use it to fix nnz for longer buffers. --- src/SparseMatricesCSR.jl | 2 +- src/SparseMatrixCSR.jl | 8 +++++--- test/SparseMatrixCSR.jl | 7 +++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/SparseMatricesCSR.jl b/src/SparseMatricesCSR.jl index e7f6654..44044b4 100644 --- a/src/SparseMatricesCSR.jl +++ b/src/SparseMatricesCSR.jl @@ -6,7 +6,7 @@ using SuiteSparse import Base: convert, copy, size, getindex, setindex!, show, count, *, IndexStyle import LinearAlgebra: mul!, lu, lu! -import SparseArrays: nnz, getnzval, nonzeros, nzrange +import SparseArrays: nnz, getnzval, nonzeros, nzvalview, nzrange import SparseArrays: findnz, rowvals, getnzval, issparse export SparseMatrixCSR diff --git a/src/SparseMatrixCSR.jl b/src/SparseMatrixCSR.jl index 24f9bb4..07b70f0 100644 --- a/src/SparseMatrixCSR.jl +++ b/src/SparseMatrixCSR.jl @@ -219,7 +219,7 @@ issparse(S::SparseMatrixCSR) = true Returns the number of stored (filled) elements in a sparse array. """ -nnz(S::SparseMatrixCSR) = length(nonzeros(S)) +nnz(S::SparseMatrixCSR) = Int(getrowptr(S)[size(S, 1) + 1]) - 1 """ nonzeros(S::SparseMatrixCSR) @@ -231,6 +231,8 @@ and any modifications to the returned vector will mutate S as well. """ nonzeros(S::SparseMatrixCSR) = S.nzval +nzvalview(S::SparseMatrixCSR) = view(nonzeros(S), 1:nnz(S)) + """ colvals(S::SparseMatrixCSR{Bi}) where {Bi} @@ -285,8 +287,8 @@ end Count the number of elements in `nonzeros(S)` for which predicate `pred` returns `true`. If `pred` not given, it counts the number of `true` values. """ -count(pred, S::SparseMatrixCSR) = count(pred, nonzeros(S)) -count(S::SparseMatrixCSR) = count(i->true, nonzeros(S)) +count(pred, S::SparseMatrixCSR) = count(pred, nzvalview(S)) +count(S::SparseMatrixCSR) = count(i->true, nzvalview(S)) function mul!(y::AbstractVector,A::SparseMatrixCSR,v::AbstractVector, α::Number, β::Number) A.n == size(v, 1) || throw(DimensionMismatch()) diff --git a/test/SparseMatrixCSR.jl b/test/SparseMatrixCSR.jl index 0526062..94a8042 100644 --- a/test/SparseMatrixCSR.jl +++ b/test/SparseMatrixCSR.jl @@ -110,6 +110,13 @@ function test_csr(Bi,Tv,Ti) @test out === CSR @test _CSR ≈ -1*CSR + # Test overlong buffers + let A = sparsecsr([1, 2, 3], [1, 2, 3], [4., 5, 6]) + push!(A.nzval, 4.0) + push!(A.rowptr, -1) + @test nnz(A) == length(SparseArrays.nzvalview(A)) == 3 + @test SparseArrays.nzvalview(A) == [4., 5, 6] + end end function test_lu(Bi,I,J,V) From 9dee3375d3f04fa006f2140589fdad566c00ff9f Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Fri, 10 Feb 2023 18:21:25 +0100 Subject: [PATCH 02/12] Adjust to `TransposeFactorization` --- Project.toml | 2 +- src/SparseMatrixCSR.jl | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 1a11c06..8145cb7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SparseMatricesCSR" uuid = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1" authors = ["Víctor Sande ", "Francesc Verdugo "] -version = "0.6.7" +version = "0.6.8" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/SparseMatrixCSR.jl b/src/SparseMatrixCSR.jl index 58f31f0..dc1567e 100644 --- a/src/SparseMatrixCSR.jl +++ b/src/SparseMatrixCSR.jl @@ -133,27 +133,31 @@ end function LinearAlgebra.lu(a::SparseMatrixCSR{0}) rowptr = _copy_and_increment(a.rowptr) colval = _copy_and_increment(a.colval) - Transpose(lu(SparseMatrixCSC(a.m,a.n,rowptr,colval,a.nzval))) + transpose(lu(SparseMatrixCSC(a.m,a.n,rowptr,colval,a.nzval))) end function LinearAlgebra.lu(a::SparseMatrixCSR{1}) - Transpose(lu(SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval))) + transpose(lu(SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval))) end if Base.USE_GPL_LIBS +const TransposeFact = isdefined(LinearAlgebra, :TransposeFact) ? + LinearAlgebra.TransposeFact : + Transpose + function LinearAlgebra.lu!( - translu::Transpose{T,<:SuiteSparse.UMFPACK.UmfpackLU{T}}, + translu::TransposeFact{T,<:SuiteSparse.UMFPACK.UmfpackLU{T}}, a::SparseMatrixCSR{1}) where {T} - Transpose(lu!(translu.parent,SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval))) + transpose(lu!(translu.parent,SparseMatrixCSC(a.m,a.n,a.rowptr,a.colval,a.nzval))) end function LinearAlgebra.lu!( - translu::Transpose{T,<:SuiteSparse.UMFPACK.UmfpackLU{T}}, + translu::TransposeFact{T,<:SuiteSparse.UMFPACK.UmfpackLU{T}}, a::SparseMatrixCSR{0}) where {T} rowptr = _copy_and_increment(a.rowptr) colval = _copy_and_increment(a.colval) - Transpose(lu!(translu.parent,SparseMatrixCSC(a.m,a.n,rowptr,colval,a.nzval))) + transpose(lu!(translu.parent,SparseMatrixCSC(a.m,a.n,rowptr,colval,a.nzval))) end end # Base.USE_GPL_LIBS From f37435f4996b22901738eef6324e44d732d8f92a Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Sat, 11 Feb 2023 18:00:54 +0100 Subject: [PATCH 03/12] fix typo --- src/SparseMatrixCSR.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SparseMatrixCSR.jl b/src/SparseMatrixCSR.jl index dc1567e..ff3af1b 100644 --- a/src/SparseMatrixCSR.jl +++ b/src/SparseMatrixCSR.jl @@ -142,8 +142,8 @@ end if Base.USE_GPL_LIBS -const TransposeFact = isdefined(LinearAlgebra, :TransposeFact) ? - LinearAlgebra.TransposeFact : +const TransposeFact = isdefined(LinearAlgebra, :TransposeFactorization) ? + LinearAlgebra.TransposeFactorization : Transpose function LinearAlgebra.lu!( From f6bb3d0be888291ca1b1fd5d4013322121e2ee30 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Fri, 4 Aug 2023 14:45:02 -0500 Subject: [PATCH 04/12] add constructors and tests --- src/SparseMatrixCSR.jl | 14 ++++++++++++++ test/SparseMatrixCSR.jl | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/SparseMatrixCSR.jl b/src/SparseMatrixCSR.jl index 58f31f0..b3731bd 100644 --- a/src/SparseMatrixCSR.jl +++ b/src/SparseMatrixCSR.jl @@ -55,6 +55,20 @@ function SparseMatrixCSR(a::Transpose{Tv,<:SparseMatrixCSC} where Tv) SparseMatrixCSR{1}(size(a,1),size(a,2),at.colptr,rowvals(at),nonzeros(at)) end +""" + SparseMatrixCSR(a::SparseMatrixCSC} + +Build a 1-based `SparseMatrixCSR` from a `SparseMatrixCSC`. +""" +SparseMatrixCSR(a::SparseMatrixCSC) = SparseMatrixCSR(transpose(sparse(transpose(a)))) + +""" + SparseMatrixCSR(a::AbstractMatrix} + +Build a 1-based `SparseMatrixCSR` from an `AbstractMatrix`. +""" +SparseMatrixCSR(a::AbstractMatrix) = SparseMatrixCSR(sparse(a)) + """ SparseMatrixCSR{Bi}(a::Transpose{Tv,<:SparseMatrixCSC} where Tv) where Bi diff --git a/test/SparseMatrixCSR.jl b/test/SparseMatrixCSR.jl index f9ef797..37c8d57 100644 --- a/test/SparseMatrixCSR.jl +++ b/test/SparseMatrixCSR.jl @@ -110,6 +110,9 @@ function test_csr(Bi,Tv,Ti) @test out === CSR @test _CSR ≈ -1*CSR + # test constructors + @test CSR == SparseMatrixCSR(CSC) + @test CSR == SparseMatrixCSR(Matrix(CSC)) end function test_lu(Bi,I,J,V) From 1a93650c5bbb3cefdf2caea4bf257bf24b456f78 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sun, 6 Aug 2023 21:10:17 -0500 Subject: [PATCH 05/12] fix test --- test/SparseMatrixCSR.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/SparseMatrixCSR.jl b/test/SparseMatrixCSR.jl index 37c8d57..79363a4 100644 --- a/test/SparseMatrixCSR.jl +++ b/test/SparseMatrixCSR.jl @@ -105,14 +105,15 @@ function test_csr(Bi,Tv,Ti) mul!(z,CSC,x) @test y ≈ z + # test constructors + @test CSR == SparseMatrixCSR(CSC) + @test CSR == SparseMatrixCSR(Matrix(CSC)) + _CSR = copy(CSR) out = LinearAlgebra.rmul!(CSR,-1) @test out === CSR @test _CSR ≈ -1*CSR - # test constructors - @test CSR == SparseMatrixCSR(CSC) - @test CSR == SparseMatrixCSR(Matrix(CSC)) end function test_lu(Bi,I,J,V) From f562dc5ed0833e372ea1d2b244d059ecceb7020a Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 9 Aug 2023 17:39:09 +0200 Subject: [PATCH 06/12] enable dependabot for GitHub actions --- .github/dependabot.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d60f070 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "monthly" From c2c897a5a1665ca59da1caccb04557679ec4f597 Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Wed, 6 Nov 2024 14:00:06 +1100 Subject: [PATCH 07/12] Expanded tests to Julia 1.10 --- .github/workflows/ci.yml | 22 ++++++++-------------- NEWS.md | 6 ++++++ README.md | 2 -- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85f2806..06cc3d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,32 +9,26 @@ jobs: matrix: version: - '1.9' + - '1.10' os: - ubuntu-latest + - windows-latest arch: - x64 steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - 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 }}- + - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v4 with: file: lcov.info + verbose: true docs: name: Documentation runs-on: ubuntu-latest @@ -42,7 +36,7 @@ jobs: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: - version: '1.9' + version: '1.10' - run: | julia --project=docs -e ' using Pkg diff --git a/NEWS.md b/NEWS.md index d9b9aee..2f6d266 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,5 @@ # Changelog + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), @@ -7,24 +8,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.6.8] - 2024.08.29 ### Fixed + - Fixed show method for SparseMatrixCSR ## [0.6.6] - 2021.11.26 ### Added + - Implemented `Base.setindex!`. ## [0.6.5] - 2021.10.20 ### Fixed + - Return value of `LinearAlbegra.fillstored!`. ### Added + - Implemented `LinearAlbegra.rmul!`. ## [0.6.4] - 2021.10.20 ### Added + - Implemented `LinearAlbegra.fillstored!`. *Previous releases are not included in this Changelog* diff --git a/README.md b/README.md index 461ff51..58ccbe6 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,3 @@ Sparse matrices in CSR format (symmetric and non-symmetric) for Julia computatio | [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://gridap.github.io/SparseMatricesCSR.jl/stable) [![](https://img.shields.io/badge/docs-dev-blue.svg)](https://gridap.github.io/SparseMatricesCSR.jl/dev) | |**Build Status** | | [![Build Status](https://github.com/gridap/SparseMatricesCSR.jl/workflows/CI/badge.svg?branch=master)](https://github.com/gridap/SparseMatricesCSR.jl/actions?query=workflow%3ACI) [![Codecov](https://codecov.io/gh/gridap/SparseMatricesCSR.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/gridap/SparseMatricesCSR.jl) | - - From 8473c78c8743c793061ec7b3abdc75760b7e457f Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Wed, 6 Nov 2024 14:17:29 +1100 Subject: [PATCH 08/12] Updated NEWS --- NEWS.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 2f6d266..a4c675e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.6.8] - 2024.08.29 +### Added + +- Added `SparseMatrixCSC` and `AbstractMatrix` constructors. + ### Fixed -- Fixed show method for SparseMatrixCSR +- Fixed show method for SparseMatrixCSR. +- Fixes related to `TransposeFactorization` (see https://github.com/JuliaLang/julia/pull/46874). ## [0.6.6] - 2021.11.26 From 79f833f8e7058ecb3a302a7da515ff043bc5b1f2 Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Wed, 6 Nov 2024 14:32:56 +1100 Subject: [PATCH 09/12] Bugfixes --- src/SparseMatrixCSR.jl | 2 +- test/SparseMatrixCSR.jl | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/SparseMatrixCSR.jl b/src/SparseMatrixCSR.jl index 6d4c44f..ac73733 100644 --- a/src/SparseMatrixCSR.jl +++ b/src/SparseMatrixCSR.jl @@ -241,7 +241,7 @@ issparse(S::SparseMatrixCSR) = true Returns the number of stored (filled) elements in a sparse array. """ -nnz(S::SparseMatrixCSR) = Int(getrowptr(S)[size(S, 1) + 1]) - 1 +nnz(S::SparseMatrixCSR{Bi}) where Bi = Int(S.rowptr[size(S, 1) + 1] - Bi) """ nonzeros(S::SparseMatrixCSR) diff --git a/test/SparseMatrixCSR.jl b/test/SparseMatrixCSR.jl index 21db89e..79fc2d9 100644 --- a/test/SparseMatrixCSR.jl +++ b/test/SparseMatrixCSR.jl @@ -79,7 +79,7 @@ function test_csr(Bi,Tv,Ti) @test getBi(CSR) == Bi @test getoffset(CSR) == 1-Bi @test nnz(CSR) == nnz(CSC) - @test length(nonzeros(CSR)) == nnz(CSR) + @test length(SparseArrays.nzvalview(CSR)) == nnz(CSR) @test nonzeros(CSR) === CSR.nzval @test colvals(CSR) === CSR.colval i,j,v = findnz(CSR) @@ -117,10 +117,10 @@ function test_csr(Bi,Tv,Ti) # Test overlong buffers let A = sparsecsr([1, 2, 3], [1, 2, 3], [4., 5, 6]) - push!(A.nzval, 4.0) - push!(A.rowptr, -1) - @test nnz(A) == length(SparseArrays.nzvalview(A)) == 3 - @test SparseArrays.nzvalview(A) == [4., 5, 6] + push!(A.nzval, 4.0) + push!(A.rowptr, -1) + @test nnz(A) == length(SparseArrays.nzvalview(A)) == 3 + @test SparseArrays.nzvalview(A) == [4., 5, 6] end end @@ -146,13 +146,13 @@ for Bi in (0,1) end if Base.USE_GPL_LIBS # `lu!` requires `SuiteSparse.UMFPACK` - I = [1,1,2,2,2,3,3] - J = [1,2,1,2,3,2,3] - V = [4.0,1.0,-1.0,4.0,1.0,-1.0,4.0] - test_lu(0,I,J,V) - test_lu(1,I,J,V) + I = [1,1,2,2,2,3,3] + J = [1,2,1,2,3,2,3] + V = [4.0,1.0,-1.0,4.0,1.0,-1.0,4.0] + test_lu(0,I,J,V) + test_lu(1,I,J,V) else - @warn "Tests run without GPL libraries." + @warn "Tests run without GPL libraries." end end # module From 2b6880f6dea51b6a507b513b4affde7543f33745 Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Wed, 6 Nov 2024 14:57:40 +1100 Subject: [PATCH 10/12] Fixed documentation --- .github/workflows/ci.yml | 1 + docs/.gitignore | 2 ++ docs/Project.toml | 1 + docs/make.jl | 8 +++++++- src/SparseMatrixCSR.jl | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 docs/.gitignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06cc3d8..8622170 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ jobs: fail-fast: false matrix: version: + - '1.8' - '1.9' - '1.10' os: diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..4cdc6db --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +Manifest.toml +build \ No newline at end of file diff --git a/docs/Project.toml b/docs/Project.toml index f6759c2..a7b73e8 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,3 +1,4 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656" SparseMatricesCSR = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1" diff --git a/docs/make.jl b/docs/make.jl index 9c7a601..15b2438 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,4 +1,9 @@ -using Documenter, SparseMatricesCSR +using Documenter, DocumenterInterLinks +using SparseMatricesCSR + +links = InterLinks( + "SparseArrays" => "https://docs.julialang.org/en/v1/" +) makedocs(; modules=[SparseMatricesCSR], @@ -9,6 +14,7 @@ makedocs(; repo="https://github.com/gridap/SparseMatricesCSR.jl/blob/{commit}{path}#L{line}", sitename="SparseMatricesCSR.jl", authors="Víctor Sande and Francesc Verdugo ", + plugins=[links], ) deploydocs(; diff --git a/src/SparseMatrixCSR.jl b/src/SparseMatrixCSR.jl index ac73733..f1e73f6 100644 --- a/src/SparseMatrixCSR.jl +++ b/src/SparseMatrixCSR.jl @@ -91,7 +91,7 @@ SparseMatrixCSR{1}(a::Transpose{Tv,<:SparseMatrixCSC} where Tv) = SparseMatrixCS Create a `SparseMatrixCSR` with `Bi`-based indexing (1 by default) from the same `args...` as one constructs a `SparseMatrixCSC` -with the [`sparse`](@ref) function. +with the [`SparseArrays.sparse`](@extref) function. """ sparsecsr(I,J,V) = SparseMatrixCSR(transpose(sparse(J,I,V,dimlub(J),dimlub(I)))) sparsecsr(I,J,V,m,n) = SparseMatrixCSR(transpose(sparse(J,I,V,n,m))) From 269ab5a09f52e2292c97430438ace19ddc743ea3 Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Wed, 6 Nov 2024 15:02:52 +1100 Subject: [PATCH 11/12] More CI --- .github/workflows/Invalidations.yml | 37 +++++++++++++++++++++++++++++ .github/workflows/ci.yml | 28 ++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/Invalidations.yml diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml new file mode 100644 index 0000000..d36b45b --- /dev/null +++ b/.github/workflows/Invalidations.yml @@ -0,0 +1,37 @@ +name: Invalidations + +on: [pull_request] + +# Cancel redundant CI tests automatically +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + invalidations: + # Only run on PRs to the default branch. + if: github.base_ref == github.event.repository.default_branch + runs-on: ubuntu-latest + steps: + - uses: julia-actions/setup-julia@v2 + with: + version: '1' + - uses: actions/checkout@v4 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-invalidations@v1 + id: invs_pr + + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.repository.default_branch }} + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-invalidations@v1 + id: invs_default + + - name: Report invalidation counts + run: | + echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY + echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY + - name: Check if the PR does increase number of invalidations + if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total + run: exit 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8622170..ed47b14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: with: file: lcov.info verbose: true + docs: name: Documentation runs-on: ubuntu-latest @@ -47,3 +48,30 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + + downgrade: + name: Downgrade ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.10' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/cache@v2 + - uses: julia-actions/julia-downgrade-compat@v1 + with: # As per documentation, we exclude packages within the Julia standard library + skip: LinearAlgebra,SparseArrays + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + with: + coverage: false From 06b4343201815ba60637b491955ec7bcbc55a37c Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Wed, 6 Nov 2024 15:12:05 +1100 Subject: [PATCH 12/12] Minor --- .github/workflows/Invalidations.yml | 37 ----------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/Invalidations.yml diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml deleted file mode 100644 index d36b45b..0000000 --- a/.github/workflows/Invalidations.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Invalidations - -on: [pull_request] - -# Cancel redundant CI tests automatically -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - invalidations: - # Only run on PRs to the default branch. - if: github.base_ref == github.event.repository.default_branch - runs-on: ubuntu-latest - steps: - - uses: julia-actions/setup-julia@v2 - with: - version: '1' - - uses: actions/checkout@v4 - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_pr - - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.repository.default_branch }} - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_default - - - name: Report invalidation counts - run: | - echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - - name: Check if the PR does increase number of invalidations - if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total - run: exit 1