From ff666e3232cdd1797215c76b073788aa7c3e1c6a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 20 Sep 2023 10:03:34 +0200 Subject: [PATCH 01/10] Set up GH Actions for CI and doc deployment Also update TagBot setup --- .github/workflows/CI.yml | 46 ++++++++++++++++++++++++++++++++++++ .github/workflows/TagBot.yml | 8 +++++-- .travis.yml | 32 ------------------------- README.md | 6 ++--- appveyor.yml | 28 ---------------------- 5 files changed, 55 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/CI.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..cfe43e3 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,46 @@ +name: CI +on: + pull_request: + push: + branches: + - master + tags: '*' +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.6' + - '1' + - 'nightly' + steps: + - uses: actions/checkout@v3 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v3 + with: + file: lcov.info + + docs: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: julia-actions/setup-julia@v1 + with: + version: '1.9' + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-docdeploy@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index d77d3a0..f49313b 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,11 +1,15 @@ name: TagBot on: - schedule: - - cron: 0 * * * * + issue_comment: + types: + - created + workflow_dispatch: jobs: TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 09c6a0e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -os: - - linux -julia: - - 0.7 - - 1.0 - - 1.1 - - 1.2 - - 1.3 - - 1.4 - - nightly -matrix: - allow_failures: - - julia: nightly -notifications: - email: false -# uncomment the following lines to override the default test script -#script: -# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi -# - julia -e 'Pkg.clone(pwd()); Pkg.build("Primes"); Pkg.test("Primes"; coverage=true)' -after_success: - - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())' -jobs: - include: - - stage: "Documentation" - julia: 1.0 - os: linux - script: - - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - julia --project=docs/ docs/make.jl - after_success: skip diff --git a/README.md b/README.md index c1f3374..58a7966 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Primes.jl -[![Build Status](https://travis-ci.org/JuliaMath/Primes.jl.svg?branch=master)](https://travis-ci.org/JuliaMath/Primes.jl) -[![Windows Build](https://ci.appveyor.com/api/projects/status/ao64pk44lwo0092r/branch/master?svg=true)](https://ci.appveyor.com/project/ararslan/primes-jl/branch/master) -[![Coverage Status](https://coveralls.io/repos/github/JuliaMath/Primes.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaMath/Primes.jl?branch=master) +[![Build Status](https://github.com/JuliaMath/Primes.jl/workflows/CI/badge.svg)](https://github.com/JuliaMath/Primes.jl/actions?query=workflow%3A%22CI%22+branch%3Amaster) +[![Codecov](https://codecov.io/gh/JuliaMath/Primes.jl/graph/badge.svg)](https://codecov.io/gh/JuliaMath/Primes.jl) + Documentation: [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaMath.github.io/Primes.jl/stable) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 13e2765..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -environment: - matrix: - - julia_version: 1.6 - - julia_version: latest - - julia_version: nightly -matrix: - allow_failures: - - julia_version: nightly -platform: - - x86 # 32-bit - - x64 # 64-bit -branches: - only: - - master - - /release-.*/ -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" From 9d78a317a28e45c08abcde4348cab455778024e4 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Wed, 20 Sep 2023 10:21:18 -0400 Subject: [PATCH 02/10] Update Documenter version --- docs/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index 981de5a..b227509 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -3,4 +3,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae" [compat] -Documenter = "~0.20" +Documenter = "~1.0" From 02522f7f7f17324ca25822020203aca2db701712 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 20 Sep 2023 18:09:19 +0200 Subject: [PATCH 03/10] Fix CI.yml --- .github/workflows/CI.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index cfe43e3..1b96059 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -8,7 +8,7 @@ on: jobs: test: name: Julia ${{ matrix.version }} - ${{ github.event_name }} - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -21,7 +21,6 @@ jobs: - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 From 6bcdd02c18c40650efb6241a6ff3c809c5908b70 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Wed, 20 Sep 2023 12:53:49 -0400 Subject: [PATCH 04/10] try to make primes visible --- docs/make.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/make.jl b/docs/make.jl index db923fe..91e49a2 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,6 @@ using Documenter, Primes +DocMeta.setdocmeta!(Primes, :DocTestSetup, :(using Primes); recursive = true) makedocs( modules = [Primes], sitename = "Primes.jl", From bf460840343c09bdca2d99376e221a7ab0a7a1c8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 20 Sep 2023 22:14:55 +0200 Subject: [PATCH 05/10] Update title page of documentation The install instructions were incomplete, and it seems pointless to mention Julia versions before 1.0. --- docs/src/index.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index d7857f0..d87cd2a 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -4,12 +4,10 @@ This package provides functions for computing prime numbers in Julia. ## Installation -The package is available for Julia versions 0.4 and up, but if you are -not using Julia version 0.7 or higher, please read the documentation for the -appropriate realease. +This release is available for Julia versions 1.6 and up. To install it, run ```julia -Pkg.add("Primes") +using Pkg ; Pkg.add("Primes") ``` from the Julia REPL. From dea3b32e04ec1df96ed2da9fa9ffd1a1374aa2a8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 20 Sep 2023 23:18:12 +0200 Subject: [PATCH 06/10] Disable failing doctest This doctest annotates the output of `divisors(60)`, which is nice, but Documenter doesn't like it. So just turn it into a plain code block without any testing. --- src/Primes.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Primes.jl b/src/Primes.jl index fc15a82..056edcb 100644 --- a/src/Primes.jl +++ b/src/Primes.jl @@ -968,7 +968,7 @@ For convenience, `divisors(0)` returns `[]`. # Example -```jldoctest +```julia julia> divisors(60) 12-element Vector{Int64}: 1 # 1 @@ -983,7 +983,8 @@ julia> divisors(60) 15 # 5 * 3 30 # 5 * 3 * 2 60 # 5 * 3 * 2 * 2 - +``` +```jldoctest julia> divisors(-10) 4-element Vector{Int64}: 1 From eb2b7bf33a6ae2d56424a497b01aa14959e99808 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 20 Sep 2023 23:26:27 +0200 Subject: [PATCH 07/10] Update make.jl --- docs/make.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/make.jl b/docs/make.jl index 91e49a2..73117d9 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -4,6 +4,7 @@ DocMeta.setdocmeta!(Primes, :DocTestSetup, :(using Primes); recursive = true) makedocs( modules = [Primes], sitename = "Primes.jl", + checkdocs = :none, pages = Any[ "Home" => "index.md", "Functions" => "api.md" From 0a613b401a5625e53437c68a06d2c960a38eee45 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Wed, 20 Sep 2023 21:46:38 -0400 Subject: [PATCH 08/10] relax version requirement for Documenter --- docs/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index b227509..7053304 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -3,4 +3,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae" [compat] -Documenter = "~1.0" +Documenter = "1.0" From 0ea5e399400bfba2755939e6445aba853958ad04 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 20 Sep 2023 22:07:12 +0200 Subject: [PATCH 09/10] divisors: add doctest filter ... to filter out annotations added to the doctest output --- src/Primes.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Primes.jl b/src/Primes.jl index 056edcb..06e5ffd 100644 --- a/src/Primes.jl +++ b/src/Primes.jl @@ -968,7 +968,7 @@ For convenience, `divisors(0)` returns `[]`. # Example -```julia +```jldoctest; filter = r"(\\s+#.*)?" julia> divisors(60) 12-element Vector{Int64}: 1 # 1 @@ -983,8 +983,7 @@ julia> divisors(60) 15 # 5 * 3 30 # 5 * 3 * 2 60 # 5 * 3 * 2 * 2 -``` -```jldoctest + julia> divisors(-10) 4-element Vector{Int64}: 1 From 617fb64a43e5b1253eea195cc30312dd38b4f543 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:16:47 +0000 Subject: [PATCH 10/10] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1b96059..def13ca 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -17,7 +17,7 @@ jobs: - '1' - 'nightly' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} @@ -33,7 +33,7 @@ jobs: name: Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: '1.9'