From 90dd6f23eb49626e4e6612cb9d64d456f86e6a1c Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Fri, 5 Jan 2024 14:39:52 -0500 Subject: [PATCH] add suggestion to use cache action if no depot is detected (#41) --- .github/workflows/ci.yml | 13 ++----------- action.yml | 12 +++++++++--- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 529ecaa..ac52419 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,18 +58,9 @@ jobs: version: ${{ matrix.version }} 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 + with: + ignore-no-cache: true env: JULIA_PKG_SERVER: ${{ matrix.pkg-server }} diff --git a/action.yml b/action.yml index 0e518b6..2d2d110 100644 --- a/action.yml +++ b/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: