From 753acf5f0102b6b79f9f495f3fca699d0899d608 Mon Sep 17 00:00:00 2001 From: Hossein Pourbozorg Date: Mon, 21 Jul 2025 01:57:45 +0330 Subject: [PATCH 1/3] add `ExplicitImports` --- test/Project.toml | 2 ++ test/quality_tests.jl | 39 ++++++++++++++++++++++++++++++++++++--- test/runtests.jl | 1 + 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index e714d422..ea7a6dcc 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -6,6 +6,7 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63" Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" +ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -28,6 +29,7 @@ DataFrames = "1" DifferentiationInterface = "0.7" Distances = "0.10" Distributions = "0.25" +ExplicitImports = "1" ForwardDiff = "1" JET = "0.9, 0.10" Lux = "1" diff --git a/test/quality_tests.jl b/test/quality_tests.jl index 4f899c43..1ff61982 100644 --- a/test/quality_tests.jl +++ b/test/quality_tests.jl @@ -1,6 +1,39 @@ Test.@testset "Quality" begin - Test.@testset "Method ambiguity" begin - Aqua.test_ambiguities(ContinuousNormalizingFlows) + Test.@testset "Aqua" begin + Test.@testset "Method ambiguity" begin + Aqua.test_ambiguities(ContinuousNormalizingFlows) + end + Aqua.test_all(ContinuousNormalizingFlows; ambiguities = (GROUP == "All")) + end + Test.@testset "ExplicitImports" begin + Test.@test isnothing( + ExplicitImports.check_no_implicit_imports(ContinuousNormalizingFlows), + ) + Test.@test isnothing( + ExplicitImports.check_all_explicit_imports_via_owners( + ContinuousNormalizingFlows, + ), + ) + Test.@test isnothing( + ExplicitImports.check_all_explicit_imports_are_public( + ContinuousNormalizingFlows, + ), + ) + Test.@test isnothing( + ExplicitImports.check_no_stale_explicit_imports(ContinuousNormalizingFlows), + ) + Test.@test isnothing( + ExplicitImports.check_all_qualified_accesses_via_owners( + ContinuousNormalizingFlows, + ), + ) + Test.@test isnothing( + ExplicitImports.check_all_qualified_accesses_are_public( + ContinuousNormalizingFlows, + ), + ) + Test.@test isnothing( + ExplicitImports.check_no_self_qualified_accesses(ContinuousNormalizingFlows), + ) end - Aqua.test_all(ContinuousNormalizingFlows; ambiguities = (GROUP == "All")) end diff --git a/test/runtests.jl b/test/runtests.jl index 70660594..04f70075 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -5,6 +5,7 @@ import ADTypes, DifferentiationInterface, Distances, Distributions, + ExplicitImports, ForwardDiff, JET, Logging, From 055e3133655b280a957b4ad01c0b71f9aad9bcd5 Mon Sep 17 00:00:00 2001 From: Hossein Pourbozorg Date: Mon, 21 Jul 2025 03:57:53 +0330 Subject: [PATCH 2/3] organize differently --- .github/workflows/CI-CheckBy.yml | 52 +++++++++++++++++++ .github/workflows/CI.yml | 2 - test/checkby_Aqua_tests.jl | 3 ++ test/checkby_ExplicitImports_tests.jl | 23 ++++++++ ...tability_tests.jl => checkby_JET_tests.jl} | 2 +- test/quality_tests.jl | 39 -------------- test/runtests.jl | 16 +++--- 7 files changed, 89 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/CI-CheckBy.yml create mode 100644 test/checkby_Aqua_tests.jl create mode 100644 test/checkby_ExplicitImports_tests.jl rename test/{instability_tests.jl => checkby_JET_tests.jl} (98%) delete mode 100644 test/quality_tests.jl diff --git a/.github/workflows/CI-CheckBy.yml b/.github/workflows/CI-CheckBy.yml new file mode 100644 index 00000000..d77d754f --- /dev/null +++ b/.github/workflows/CI-CheckBy.yml @@ -0,0 +1,52 @@ +name: CI +on: + schedule: + - cron: '0 0 * * 0' + push: + branches: + - main + tags: + - v* + pull_request: + release: + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + group: + - CheckByAqua + - CheckByJET + - CheckByExplicitImports + version: + - release + - lts + - nightly + os: + - ubuntu-latest + # - macOS-latest + # - windows-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/install-juliaup@v2 + with: + channel: ${{ matrix.version }} + - uses: julia-actions/cache@v2 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + env: + GROUP: ${{ matrix.group }} + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v5 + with: + files: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + # - uses: julia-actions/julia-uploadcoveralls@v1 + # env: + # COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f173b0d9..fe47ee29 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,8 +25,6 @@ jobs: - SmokeXYOut - SmokeXYIn - Regression - - Quality - - Instability version: - release - lts diff --git a/test/checkby_Aqua_tests.jl b/test/checkby_Aqua_tests.jl new file mode 100644 index 00000000..ffec5c16 --- /dev/null +++ b/test/checkby_Aqua_tests.jl @@ -0,0 +1,3 @@ +Test.@testset "CheckByAqua" begin + Aqua.test_all(ContinuousNormalizingFlows) +end diff --git a/test/checkby_ExplicitImports_tests.jl b/test/checkby_ExplicitImports_tests.jl new file mode 100644 index 00000000..e4085485 --- /dev/null +++ b/test/checkby_ExplicitImports_tests.jl @@ -0,0 +1,23 @@ +Test.@testset "CheckByExplicitImports" begin + Test.@test isnothing( + ExplicitImports.check_no_implicit_imports(ContinuousNormalizingFlows), + ) + Test.@test isnothing( + ExplicitImports.check_all_explicit_imports_via_owners(ContinuousNormalizingFlows), + ) + Test.@test isnothing( + ExplicitImports.check_all_explicit_imports_are_public(ContinuousNormalizingFlows), + ) + Test.@test isnothing( + ExplicitImports.check_no_stale_explicit_imports(ContinuousNormalizingFlows), + ) + Test.@test isnothing( + ExplicitImports.check_all_qualified_accesses_via_owners(ContinuousNormalizingFlows), + ) + Test.@test isnothing( + ExplicitImports.check_all_qualified_accesses_are_public(ContinuousNormalizingFlows), + ) + Test.@test isnothing( + ExplicitImports.check_no_self_qualified_accesses(ContinuousNormalizingFlows), + ) +end diff --git a/test/instability_tests.jl b/test/checkby_JET_tests.jl similarity index 98% rename from test/instability_tests.jl rename to test/checkby_JET_tests.jl index e8c52728..fe247500 100644 --- a/test/instability_tests.jl +++ b/test/checkby_JET_tests.jl @@ -1,4 +1,4 @@ -Test.@testset "Instability" begin +Test.@testset "CheckByJET" begin JET.test_package( ContinuousNormalizingFlows; target_modules = [ContinuousNormalizingFlows], diff --git a/test/quality_tests.jl b/test/quality_tests.jl deleted file mode 100644 index 1ff61982..00000000 --- a/test/quality_tests.jl +++ /dev/null @@ -1,39 +0,0 @@ -Test.@testset "Quality" begin - Test.@testset "Aqua" begin - Test.@testset "Method ambiguity" begin - Aqua.test_ambiguities(ContinuousNormalizingFlows) - end - Aqua.test_all(ContinuousNormalizingFlows; ambiguities = (GROUP == "All")) - end - Test.@testset "ExplicitImports" begin - Test.@test isnothing( - ExplicitImports.check_no_implicit_imports(ContinuousNormalizingFlows), - ) - Test.@test isnothing( - ExplicitImports.check_all_explicit_imports_via_owners( - ContinuousNormalizingFlows, - ), - ) - Test.@test isnothing( - ExplicitImports.check_all_explicit_imports_are_public( - ContinuousNormalizingFlows, - ), - ) - Test.@test isnothing( - ExplicitImports.check_no_stale_explicit_imports(ContinuousNormalizingFlows), - ) - Test.@test isnothing( - ExplicitImports.check_all_qualified_accesses_via_owners( - ContinuousNormalizingFlows, - ), - ) - Test.@test isnothing( - ExplicitImports.check_all_qualified_accesses_are_public( - ContinuousNormalizingFlows, - ), - ) - Test.@test isnothing( - ExplicitImports.check_no_self_qualified_accesses(ContinuousNormalizingFlows), - ) - end -end diff --git a/test/runtests.jl b/test/runtests.jl index 04f70075..23c12139 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -35,15 +35,19 @@ Test.@testset "Overall" begin include("smoke_tests.jl") end - if GROUP == "All" || GROUP == "Quality" - include("quality_tests.jl") + if GROUP == "All" || GROUP == "Regression" + include("regression_tests.jl") end - if GROUP == "All" || GROUP == "Instability" - include("instability_tests.jl") + if GROUP == "All" || GROUP == "CheckByAqua" + include("checkby_Aqua_tests.jl") end - if GROUP == "All" || GROUP == "Regression" - include("regression_tests.jl") + if GROUP == "All" || GROUP == "CheckByJET" + include("checkby_JET_tests.jl") + end + + if GROUP == "All" || GROUP == "CheckByExplicitImports" + include("checkby_ExplicitImports_tests.jl") end end From 1abfac8191ccb5d9e95869d6c617159c3062e3c0 Mon Sep 17 00:00:00 2001 From: Hossein Pourbozorg Date: Mon, 21 Jul 2025 06:00:35 +0330 Subject: [PATCH 3/3] fix --- .github/workflows/CI-CheckBy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI-CheckBy.yml b/.github/workflows/CI-CheckBy.yml index d77d754f..509e217b 100644 --- a/.github/workflows/CI-CheckBy.yml +++ b/.github/workflows/CI-CheckBy.yml @@ -1,4 +1,4 @@ -name: CI +name: CI-CheckBy on: schedule: - cron: '0 0 * * 0'