Version 1.6.0 (#26) #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code checks | |
on: | |
pull_request: | |
push: | |
branches: ["master"] | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
explicit-imports: | |
runs-on: ubuntu-latest | |
name: "ExplicitImports.jl" | |
steps: | |
- uses: actions/checkout@v4 | |
# - uses: julia-actions/setup-julia@v2 | |
# with: | |
# version: '1' | |
- uses: julia-actions/cache@v2 | |
# - uses: julia-actions/julia-buildpkg@v1 | |
- name: Install dependencies | |
shell: julia --project=@explicit-imports {0} | |
run: | | |
# Add ExplicitImports.jl and packages that HYPRE has extensions for | |
using Pkg | |
Pkg.develop([ | |
PackageSpec(name = "HYPRE", path = pwd()), | |
]) | |
Pkg.add([ | |
PackageSpec(name = "ExplicitImports", version = "1.9"), | |
PackageSpec(name = "PartitionedArrays"), | |
PackageSpec(name = "SparseArrays"), | |
PackageSpec(name = "SparseMatricesCSR"), | |
]) | |
- name: ExplicitImports.jl code checks | |
shell: julia --project=@explicit-imports {0} | |
run: | | |
using HYPRE, ExplicitImports, PartitionedArrays, SparseArrays, SparseMatricesCSR | |
# Check HYPRE | |
check_no_implicit_imports(HYPRE) | |
check_no_stale_explicit_imports(HYPRE) | |
check_all_qualified_accesses_via_owners(HYPRE) | |
check_no_self_qualified_accesses(HYPRE) | |
# Check extension modules | |
for ext in (:HYPREPartitionedArrays, :HYPRESparseArrays, :HYPRESparseMatricesCSR) | |
extmod = Base.get_extension(HYPRE, ext) | |
if extmod !== nothing | |
check_no_implicit_imports(extmod) | |
check_no_stale_explicit_imports(extmod) | |
check_all_qualified_accesses_via_owners(extmod) | |
check_no_self_qualified_accesses(extmod) | |
else | |
@warn "$(ext) extension not available." | |
end | |
end |