add suggestion to use cache action if no depot is detected (#41)

This commit is contained in:
Ian Butterworth
2024-01-05 14:39:52 -05:00
committed by GitHub
parent d4b940ea5e
commit 90dd6f23eb
2 changed files with 11 additions and 14 deletions

View File

@@ -58,18 +58,9 @@ jobs:
version: ${{ matrix.version }} version: ${{ matrix.version }}
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: ./.github/actions/julia-buildpkg - uses: ./.github/actions/julia-buildpkg
with:
ignore-no-cache: true
env: env:
JULIA_PKG_SERVER: ${{ matrix.pkg-server }} JULIA_PKG_SERVER: ${{ matrix.pkg-server }}

View File

@@ -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. 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' Options: true | false. Default : 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: runs:
using: 'composite' using: 'composite'
@@ -29,8 +32,11 @@ runs:
run: echo "JULIA_PKG_SERVER_REGISTRY_PREFERENCE=${JULIA_PKG_SERVER_REGISTRY_PREFERENCE:-eager}" >> ${GITHUB_ENV} run: echo "JULIA_PKG_SERVER_REGISTRY_PREFERENCE=${JULIA_PKG_SERVER_REGISTRY_PREFERENCE:-eager}" >> ${GITHUB_ENV}
shell: bash shell: bash
- run: | - 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 import Pkg
# Determine if Pkg uses git-cli executable instead of LibGit2 # Determine if Pkg uses git-cli executable instead of LibGit2
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 }})
@@ -44,14 +50,14 @@ runs:
# If provided add local registries # If provided add local registries
if !isempty("${{ inputs.localregistry }}") if !isempty("${{ inputs.localregistry }}")
local_repos = split("${{ inputs.localregistry }}", "\n") .|> string local_repos = split("${{ inputs.localregistry }}", "\n") .|> string
for repo_url in local_repos for repo_url in local_repos
isempty(repo_url) && continue isempty(repo_url) && continue
Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url)) Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url))
end end
end end
end end
VERSION >= v"1.1.0-rc1" ? retry(Pkg.build)(verbose=true) : retry(Pkg.build)() VERSION >= v"1.1.0-rc1" ? retry(Pkg.build)(verbose=true) : retry(Pkg.build)()
shell: julia --color=yes --project=${{ inputs.project }} {0} shell: julia --color=yes --project=${{ inputs.project }} {0}
env: env: