mirror of
https://github.com/julia-actions/julia-buildpkg.git
synced 2026-02-12 01:16:54 +08:00
add suggestion to use cache action if no depot is detected (#41)
This commit is contained in:
12
action.yml
12
action.yml
@@ -21,6 +21,9 @@ inputs:
|
||||
description: 'Determine if Pkg uses the cli git executable (Julia >= 1.7). Might be necessary for more complicated SSH setups.
|
||||
Options: true | false. Default : false'
|
||||
default: 'false'
|
||||
ignore-no-cache:
|
||||
description: 'Whether to ignore if there appears to be no depot caching. Silences an action notice recommending `julia-actions/cache`.'
|
||||
default: 'false'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
@@ -29,8 +32,11 @@ runs:
|
||||
run: echo "JULIA_PKG_SERVER_REGISTRY_PREFERENCE=${JULIA_PKG_SERVER_REGISTRY_PREFERENCE:-eager}" >> ${GITHUB_ENV}
|
||||
shell: bash
|
||||
- run: |
|
||||
if "${{ inputs.ignore-no-cache }}" == "false" && !isdir(DEPOT_PATH[1])
|
||||
println("::notice title=[julia-buildpkg] Caching of the julia depot was not detected ::Consider using `julia-actions/cache` to speed up runs https://github.com/julia-actions/cache. To ignore, set input `ignore-no-cache: true` ")
|
||||
end
|
||||
import Pkg
|
||||
|
||||
|
||||
# Determine if Pkg uses git-cli executable instead of LibGit2
|
||||
VERSION >= v"1.7-" && (ENV["JULIA_PKG_USE_CLI_GIT"] = ${{ inputs.git_cli }})
|
||||
|
||||
@@ -44,14 +50,14 @@ runs:
|
||||
|
||||
# If provided add local registries
|
||||
if !isempty("${{ inputs.localregistry }}")
|
||||
local_repos = split("${{ inputs.localregistry }}", "\n") .|> string
|
||||
local_repos = split("${{ inputs.localregistry }}", "\n") .|> string
|
||||
for repo_url in local_repos
|
||||
isempty(repo_url) && continue
|
||||
Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
VERSION >= v"1.1.0-rc1" ? retry(Pkg.build)(verbose=true) : retry(Pkg.build)()
|
||||
shell: julia --color=yes --project=${{ inputs.project }} {0}
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user