Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the optional tool-cache input, which allows the user to override the location into which Julia is installed #100

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/example-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ jobs:
npm run build
npm run pack

- run: mkdir -p ${{ github.workspace }}/dilumtestcache # TODO: delete this line
- name: "Set up Julia"
id: setup-julia
uses: ./
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
tool-cache: ${{ github.workspace }}/dilumtestcache # TODO: delete this line
- run: which julia # TODO: delete this line
- run: which -a julia # TODO: delete this line
- run: julia --version
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Setup Julia environment'
description: 'Setup a Julia environment and add it to the PATH'
author: 'Sascha Mann'
inputs:
inputs:
version:
description: 'The Julia version to download (if necessary) and use. Example: 1.0.4'
default: '1'
Expand All @@ -13,6 +13,10 @@ inputs:
description: 'Display InteractiveUtils.versioninfo() after installing'
required: false
default: 'false'
tool-cache:
description: 'Override the value of the RUNNER_TOOL_CACHE environment variable.'
required: false
default: ''
outputs:
julia-version:
description: 'The installed Julia version. May vary from the version input if a version range was given as input.'
Expand Down
8 changes: 8 additions & 0 deletions lib/setup-julia.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/setup-julia.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import * as core from '@actions/core'

// If we want to override the `RUNNER_TOOL_CACHE` environment variable, we need
// to do it before we load ``@actions/tool-cache`
const tool_cache_input_original = core.getInput('tool-cache')
const tool_cache_input_trimmed = tool_cache_input_original.trim()
if (tool_cache_input_trimmed.length > 0) {
process.env['RUNNER_TOOL_CACHE'] = tool_cache_input_trimmed
console.log('Overriding RUNNER_TOOL_CACHE -> ', process.env['RUNNER_TOOL_CACHE'])
}

import * as exec from '@actions/exec'
import * as tc from '@actions/tool-cache'

Expand Down