mirror of
https://github.com/julia-actions/julia-buildpkg.git
synced 2026-02-12 09:26:54 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
252d4686a5 |
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -15,7 +15,6 @@ on:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -31,6 +30,9 @@ jobs:
|
||||
arch:
|
||||
- x64
|
||||
- x86
|
||||
pkg-server:
|
||||
- ""
|
||||
- "pkg.julialang.org"
|
||||
# 32-bit Julia binaries are not available on macOS
|
||||
exclude:
|
||||
- os: macOS-latest
|
||||
@@ -68,6 +70,8 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
|
||||
- uses: ./.github/actions/julia-buildpkg
|
||||
env:
|
||||
JULIA_PKG_SERVER: ${{ matrix.pkg-server }}
|
||||
|
||||
- uses: julia-actions/julia-runtest@v1
|
||||
|
||||
|
||||
@@ -25,14 +25,8 @@ runs:
|
||||
# * 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
|
||||
- run: julia --color=yes "$GITHUB_ACTION_PATH"/add_general_registry.buildpkg.jl
|
||||
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: ""
|
||||
|
||||
- run: julia --color=yes --project=${{ inputs.project }} -e 'using Pkg; if VERSION >= v"1.1.0-rc1"; Pkg.build(verbose=true); else Pkg.build(); end'
|
||||
shell: bash
|
||||
|
||||
@@ -18,22 +18,35 @@ function general_registry_exists()
|
||||
if isfile(general_registry_tarball) && isfile(registry_toml_file)
|
||||
return true
|
||||
end
|
||||
|
||||
general_registry_dir, registry_toml_file = cloned_general_registry_location()
|
||||
if !isdir(general_registry_dir)
|
||||
return false
|
||||
elseif !isfile(registry_toml_file)
|
||||
return false
|
||||
else
|
||||
if isdir(general_registry_dir) && isfile(registry_toml_file)
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function add_general_registry()
|
||||
@info("Attempting to clone the General registry")
|
||||
general_registry_dir, registry_toml_file = general_registry_location()
|
||||
@info("Attempting to install the General registry")
|
||||
|
||||
general_registry_tarball, registry_toml_file = tarball_general_registry_location()
|
||||
rm(general_registry_tarball; force = true, recursive = true)
|
||||
rm(registry_toml_file; force = true, recursive = true)
|
||||
|
||||
general_registry_dir, registry_toml_file = cloned_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"))
|
||||
|
||||
# If not already set, We set `JULIA_PKG_SERVER` 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`.
|
||||
pkg_server = get(ENV, "JULIA_PKG_SERVER", "")
|
||||
withenv("JULIA_PKG_SERVER" => pkg_server) do
|
||||
Pkg.Registry.add("General")
|
||||
end
|
||||
|
||||
general_registry_exists() || throw(ErrorException("The Registry was not intalled properly"))
|
||||
return nothing
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user