Compare commits

..

5 Commits

Author SHA1 Message Date
Sascha Mann
0fb79b8f6a Improve deprecation warning 2023-03-15 23:05:59 +01:00
Sascha Mann
a29dc8944a Remove linebreaks 2023-03-15 23:04:45 +01:00
Sascha Mann
e4bba91d95 Deprecate @master
Turns out GitHub doesn't forward @master to @main
2023-03-15 22:59:44 +01:00
Fredrik Ekre
3378215696 Export the JULIA_PKG_SERVER_REGISTRY_PREFERENCE variable for subsequent steps. (#75) 2023-03-13 18:32:24 +01:00
Fredrik Ekre
ba451bf755 Use eager registry flavor instead of git clone. (#74) 2023-03-13 12:21:51 +01:00
3 changed files with 17 additions and 64 deletions

View File

@@ -78,3 +78,13 @@ If you only want to add this prefix on certain builds, you can [include addition
```
This will add the prefix `xvfb-run` to all builds where the `os` is `ubuntu-latest`.
### Registry flavor preference
This actions defines (and exports for subsequent steps of the workflow) the
environmental variable `JULIA_PKG_SERVER_REGISTRY_PREFERENCE=eager` unless it
is already set. If you want another registry flavor (i.e. `conservative`) this
should be defined in the `env:` section of the relevant workflow or step. See
[Registry flavors](https://pkgdocs.julialang.org/dev/registries/#Registry-flavors)
for more information.

View File

@@ -36,22 +36,14 @@ inputs:
runs:
using: 'composite'
steps:
# Occasionally, there are rather large delays (> a few hours)
# between the time a package is registered in General and
# propagated to pkg.julialang.org. We can avoid this by manually
# cloning ~/.julia/registries/General/ in Julia 1.5 and later.
# See:
# * https://github.com/JuliaLang/Pkg.jl/issues/2011
# * https://github.com/JuliaRegistries/General/issues/16777
# * https://github.com/JuliaPackaging/PkgServer.jl/issues/60
- run: julia --color=yes "$GITHUB_ACTION_PATH"/add_general_registry.jl
- name: 'DEPRECATION WARNING: julia-actions/julia-runtest@master will no longer receive updates and will start to error in the future. Please use version tags like julia-actions/julia-runtest@v1 or commit SHAs in your workflows!'
run: |
echo "::warning title=DEPRECATION WARNING::julia-actions/julia-runtest@master will no longer receive updates and will start to error in the future. Please use version tags like julia-actions/julia-runtest@v1 or commit SHAs in your workflows!"
echo "# :warning: DEPRECATION WARNING :warning: julia-actions/julia-runtest@master will no longer receive updates and will start to error in the future. Please use version tags like julia-actions/julia-runtest@v1 or commit SHAs in your workflows!" >> $GITHUB_STEP_SUMMARY
shell: bash
- name: Set and export registry flavor preference
run: echo "JULIA_PKG_SERVER_REGISTRY_PREFERENCE=${JULIA_PKG_SERVER_REGISTRY_PREFERENCE:-eager}" >> ${GITHUB_ENV}
shell: bash
env:
# We set `JULIA_PKG_SERVER` only for this step to enforce
# `Pkg.Registry.add` to use Git. This way, Pkg.jl can send
# the request metadata to pkg.julialang.org when installing
# packages via `Pkg.test`.
JULIA_PKG_SERVER: ""
- name: Install dependencies in their own (shared) environment
run: |
if VERSION > v"1.8pre"

View File

@@ -1,49 +0,0 @@
using Pkg
function general_registry_location()
general_registry_dir = joinpath(DEPOT_PATH[1], "registries", "General")
registry_toml_file = joinpath(general_registry_dir, "Registry.toml")
return general_registry_dir, registry_toml_file
end
function general_registry_exists()
general_registry_dir, registry_toml_file = general_registry_location()
if !isdir(general_registry_dir)
return false
elseif !isfile(registry_toml_file)
return false
else
return true
end
end
function add_general_registry()
@info("Attempting to clone the General registry")
general_registry_dir, registry_toml_file = general_registry_location()
rm(general_registry_dir; force = true, recursive = true)
Pkg.Registry.add("General")
isfile(registry_toml_file) || throw(ErrorException("the Registry.toml file does not exist"))
return nothing
end
function main(; n = 10, max_delay = 120)
VERSION >= v"1.5-" || return
if general_registry_exists()
@info("The General registry already exists locally")
return
end
delays = ExponentialBackOff(; n = n, max_delay = max_delay)
try
retry(add_general_registry; delays = delays)()
@info("Successfully added the General registry")
catch ex
msg = "I was unable to add the General registry. However, the build will continue."
@error(msg, exception=(ex,catch_backtrace()))
end
return
end
main()