Compare commits

..

9 Commits

Author SHA1 Message Date
Curtis Vogt
ad723e2fe5 Avoid attempting to test pkg server on Julia <1.7 2024-01-10 15:07:02 -06:00
Curtis Vogt
33033861f0 Drop reference to branch master in workflow 2024-01-10 14:59:15 -06:00
Curtis Vogt
a208c66935 Use fast-fail only on PRs 2024-01-10 14:59:15 -06:00
Curtis Vogt
3c1df8e430 Add registry clone skip test 2024-01-10 14:59:05 -06:00
Curtis Vogt
93acad015a Prefer using ENV for local registry to make CI output easier to read 2024-01-10 14:55:40 -06:00
Curtis Vogt
951839e464 Support Julia 1.5 for reachable registries 2024-01-09 15:18:13 -06:00
Curtis Vogt
bfc4263fef Remove empty repo URLs with keepempty 2024-01-09 15:17:15 -06:00
Curtis Vogt
320bd0725f Use consisten indentation 2024-01-09 15:16:47 -06:00
Curtis Vogt
ab02b8f55c Add Julia registries only when not present 2024-01-09 14:58:51 -06:00
2 changed files with 40 additions and 12 deletions

View File

@@ -4,7 +4,6 @@ on:
push: push:
branches: branches:
- "main" - "main"
- "master"
paths-ignore: paths-ignore:
- "README.md" - "README.md"
- "LICENSE" - "LICENSE"
@@ -17,10 +16,11 @@ jobs:
test: test:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: ${{ github.event_name == 'pull_request' }}
matrix: matrix:
version: version:
- "1.0" - "1.0"
- "1.6" # Long-term support (LTS) release of Julia
- "1" # automatically expands to the latest stable 1.x release of Julia - "1" # automatically expands to the latest stable 1.x release of Julia
- nightly - nightly
os: os:
@@ -33,10 +33,15 @@ jobs:
pkg-server: pkg-server:
- "" - ""
- "pkg.julialang.org" - "pkg.julialang.org"
# 32-bit Julia binaries are not available on macOS
exclude: exclude:
# 32-bit Julia binaries are not available on macOS
- os: macOS-latest - os: macOS-latest
arch: x86 arch: x86
# Only Julia 1.7+ can use the package server
- version: "1.0"
pkg-server: "pkg.julialang.org"
- version: "1.6"
pkg-server: "pkg.julialang.org"
steps: steps:
- name: Checkout Example.jl - name: Checkout Example.jl
@@ -61,9 +66,20 @@ jobs:
- uses: ./.github/actions/julia-buildpkg - uses: ./.github/actions/julia-buildpkg
with: with:
ignore-no-cache: true ignore-no-cache: true
localregistry: |
https://github.com/JuliaRegistries/General.git
env: env:
JULIA_PKG_SERVER: ${{ matrix.pkg-server }} JULIA_PKG_SERVER: ${{ matrix.pkg-server }}
# When using the Pkg server the `Pkg.Registry.add("General")` will add the General registry
# via Pkg servers. Using `localregistry` to clone the General registry via HTTPS should be
# skipped.
- name: Test skipping registry cloning of duplicate repos
if: ${{ matrix.pkg-server == 'pkg.julialang.org' }}
shell: bash
run: |
! test -d $HOME/.julia/registries/General
- uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1 - uses: julia-actions/julia-processcoverage@v1

View File

@@ -41,20 +41,31 @@ runs:
VERSION >= v"1.7-" && (ENV["JULIA_PKG_USE_CLI_GIT"] = ${{ inputs.git_cli }}) VERSION >= v"1.7-" && (ENV["JULIA_PKG_USE_CLI_GIT"] = ${{ inputs.git_cli }})
if VERSION < v"1.7-" && ${{ inputs.git_cli }} == true if VERSION < v"1.7-" && ${{ inputs.git_cli }} == true
printstyled("::notice::JULIA_PKG_USE_CLI_GIT requires Julia >= 1.7. Using default LibGit2 git-interface instead! \n"; color = :yellow) printstyled("::notice::JULIA_PKG_USE_CLI_GIT requires Julia >= 1.7. Using default LibGit2 git-interface instead! \n"; color = :yellow)
end end
if VERSION >= v"1.5-" if VERSION >= v"1.5-"
Pkg.Registry.add("General") function reachable_registries()
return if VERSION >= v"1.7-"
Pkg.Registry.reachable_registries()
else
[(; name=r.name, repo=r.url) for r in Pkg.Types.collect_registries()]
end
end
if !any(r -> r.name == "General", reachable_registries())
Pkg.Registry.add("General")
end
# If provided add local registries # If provided add local registries
if !isempty("${{ inputs.localregistry }}") if !isempty(ENV["LOCAL_REGISTRY"])
local_repos = split("${{ inputs.localregistry }}", "\n") .|> string local_repos = split(ENV["LOCAL_REGISTRY"], "\n"; keepempty=false) .|> string
for repo_url in local_repos for repo_url in local_repos
isempty(repo_url) && continue # https://github.com/JuliaLang/Pkg.jl/issues/3753
Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url)) if !any(r -> r.repo == repo_url, reachable_registries())
end Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url))
end
end
end end
end end
@@ -63,3 +74,4 @@ runs:
env: env:
JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.precompile }}" JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.precompile }}"
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
LOCAL_REGISTRY: ${{ inputs.localregistry }}