diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d19056e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +enable-beta-ecosystems: true +updates: + - package-ecosystem: "julia" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + groups: + actions: + patterns: + - "*" diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml deleted file mode 100644 index b57619a..0000000 --- a/.github/workflows/CompatHelper.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: CompatHelper - -on: - schedule: - - cron: '00 00 * * *' - workflow_dispatch: - -jobs: - CompatHelper: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1.2.0] - julia-arch: [x86] - os: [ubuntu-latest] - steps: - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMPATHELPER_PRIV: ${{ secrets.TAGBOT }} - run: julia -e 'using CompatHelper; CompatHelper.main()' diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index d7fb955..fb86c5d 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -19,21 +19,12 @@ jobs: julia-arch: [x86] os: [ubuntu-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@latest with: version: ${{ matrix.julia-version }} - name: Cache artifacts - 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@v3 - name: Install dependencies run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: Build and deploy diff --git a/.github/workflows/UnitTest.yml b/.github/workflows/UnitTest.yml index 8cfefd4..603e669 100644 --- a/.github/workflows/UnitTest.yml +++ b/.github/workflows/UnitTest.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - julia-version: ['1.0', '1', 'nightly'] + julia-version: ['1.6', '1', 'nightly'] os: [ubuntu-latest] arch: [x64] include: @@ -30,27 +30,19 @@ jobs: arch: x86 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: "Set up Julia" - uses: julia-actions/setup-julia@v1 + uses: julia-actions/setup-julia@v3 with: version: ${{ matrix.julia-version }} - name: Cache artifacts - 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@v3 - name: "Unit Test" - uses: julia-actions/julia-runtest@master + uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v6 with: - file: lcov.info + files: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Project.toml b/Project.toml index f01d448..813f50d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ImageEdgeDetection" uuid = "2b14c160-480b-11ea-1b58-656063328ff7" authors = ["Dr. Zygmunt L. Szpak"] -version = "0.1.8" +version = "0.1.9" [deps] DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" @@ -15,8 +15,8 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" [compat] -DataStructures = "0.17, 0.18" -ImageCore = "0.9" +DataStructures = "0.17, 0.18, 0.19" +ImageCore = "0.9, 0.10" ImageFiltering = "0.7" Interpolations = "0.10, 0.11, 0.12, 0.13, 0.14" Parameters = "0.12" @@ -24,7 +24,7 @@ Setfield = "1.0, 1.1" StaticArrays = "0.10, 0.11, 0.12, 1.0" StatsBase = "0.32, 0.33, 0.34" UnPack = "1.0" -julia = "1" +julia = "1.6" [extras] FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" diff --git a/test/testutils.jl b/test/testutils.jl index 9dec29a..60cb021 100644 --- a/test/testutils.jl +++ b/test/testutils.jl @@ -14,14 +14,23 @@ function generate_test_types(number_types::AbstractArray{<:DataType}, color_type test_types end -function edge_detection_equality(ratio = 0.0) +function edge_detection_equality(ratio = 0.005) + # Compare edge maps as binary masks. Reference images load as N0f8 with + # values exactly in {0, 1}, but the actual may carry floating-point noise + # from upstream colorspace conversions (e.g. Lab(0,0,0) → Gray(4.38e-10), + # Lab(100,0,0) → Gray(0.9999999)) — so bit-exact comparison spuriously + # marks every pixel as different. A small `ratio` also absorbs the handful + # of near-threshold pixels that flip between edge/non-edge across library + # versions (e.g. Lab→Gray rounding shifting a few NMS pixels). + is_edge(v) = float(real(v)) > 0.5 + function (ref, x) if size(ref) != size(x) @warn "test fails because size(ref) != size(x)" return false end - count = sum(ref .!= x) + count = sum(is_edge.(ref) .!= is_edge.(x)) max_count = ceil(Int, length(ref)*ratio) rst = count <= max_count if !rst