Skip to content

Commit 90dd6f2

Browse files
add suggestion to use cache action if no depot is detected (#41)
1 parent d4b940e commit 90dd6f2

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,9 @@ jobs:
5858
version: ${{ matrix.version }}
5959
arch: ${{ matrix.arch }}
6060

61-
- uses: actions/cache@v3
62-
env:
63-
cache-name: cache-artifacts
64-
with:
65-
path: ~/.julia/artifacts
66-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
67-
restore-keys: |
68-
${{ runner.os }}-test-${{ env.cache-name }}-
69-
${{ runner.os }}-test-
70-
${{ runner.os }}-
71-
7261
- uses: ./.github/actions/julia-buildpkg
62+
with:
63+
ignore-no-cache: true
7364
env:
7465
JULIA_PKG_SERVER: ${{ matrix.pkg-server }}
7566

action.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ inputs:
2121
description: 'Determine if Pkg uses the cli git executable (Julia >= 1.7). Might be necessary for more complicated SSH setups.
2222
Options: true | false. Default : false'
2323
default: 'false'
24+
ignore-no-cache:
25+
description: 'Whether to ignore if there appears to be no depot caching. Silences an action notice recommending `julia-actions/cache`.'
26+
default: 'false'
2427

2528
runs:
2629
using: 'composite'
@@ -29,8 +32,11 @@ runs:
2932
run: echo "JULIA_PKG_SERVER_REGISTRY_PREFERENCE=${JULIA_PKG_SERVER_REGISTRY_PREFERENCE:-eager}" >> ${GITHUB_ENV}
3033
shell: bash
3134
- run: |
35+
if "${{ inputs.ignore-no-cache }}" == "false" && !isdir(DEPOT_PATH[1])
36+
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` ")
37+
end
3238
import Pkg
33-
39+
3440
# Determine if Pkg uses git-cli executable instead of LibGit2
3541
VERSION >= v"1.7-" && (ENV["JULIA_PKG_USE_CLI_GIT"] = ${{ inputs.git_cli }})
3642
@@ -44,14 +50,14 @@ runs:
4450
4551
# If provided add local registries
4652
if !isempty("${{ inputs.localregistry }}")
47-
local_repos = split("${{ inputs.localregistry }}", "\n") .|> string
53+
local_repos = split("${{ inputs.localregistry }}", "\n") .|> string
4854
for repo_url in local_repos
4955
isempty(repo_url) && continue
5056
Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url))
5157
end
5258
end
5359
end
54-
60+
5561
VERSION >= v"1.1.0-rc1" ? retry(Pkg.build)(verbose=true) : retry(Pkg.build)()
5662
shell: julia --color=yes --project=${{ inputs.project }} {0}
5763
env:

0 commit comments

Comments
 (0)