Version ghcup (#3)
* Version ghcup * Don't cache something that needs to be tested for correctness
This commit is contained in:
7
.github/workflows/workflow.yml
vendored
7
.github/workflows/workflow.yml
vendored
@@ -44,13 +44,6 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
|
||||||
if: matrix.os == 'macOS-latest'
|
|
||||||
with:
|
|
||||||
path: ~/.ghcup
|
|
||||||
key: ${{ runner.os }}-${{ matrix.ghc }}-ghcup
|
|
||||||
|
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ghc-version: ${{ matrix.ghc }}
|
ghc-version: ${{ matrix.ghc }}
|
||||||
|
|||||||
25
dist/action.yml
vendored
25
dist/action.yml
vendored
@@ -4,25 +4,40 @@ author: 'GitHub'
|
|||||||
inputs:
|
inputs:
|
||||||
ghc-version:
|
ghc-version:
|
||||||
required: false
|
required: false
|
||||||
description: 'Version of ghc to use.'
|
description: 'Version of GHC to use. If set to "latest", it will always get the latest stable version.'
|
||||||
default: '8.8'
|
default: 'latest'
|
||||||
cabal-version:
|
cabal-version:
|
||||||
required: false
|
required: false
|
||||||
description: 'Version of cabal to use. If set to "latest", it will always get the latest stable version.'
|
description: 'Version of Cabal to use. If set to "latest", it will always get the latest stable version.'
|
||||||
default: 'latest'
|
default: 'latest'
|
||||||
stack-version:
|
stack-version:
|
||||||
required: false
|
required: false
|
||||||
description: 'Version of stack to use. If set to "latest", it will always get the latest stable version.'
|
description: 'Version of Stack to use. If set to "latest", it will always get the latest stable version.'
|
||||||
default: 'latest'
|
default: 'latest'
|
||||||
enable-stack:
|
enable-stack:
|
||||||
required: false
|
required: false
|
||||||
description: 'If specified, will setup stack'
|
description: 'If specified, will setup Stack'
|
||||||
stack-no-global:
|
stack-no-global:
|
||||||
required: false
|
required: false
|
||||||
description: 'If specified, enable-stack must be set. Prevents installing GHC and Cabal globally'
|
description: 'If specified, enable-stack must be set. Prevents installing GHC and Cabal globally'
|
||||||
stack-setup-ghc:
|
stack-setup-ghc:
|
||||||
required: false
|
required: false
|
||||||
description: 'If specified, enable-stack must be set. Will run stack setup to install the specified GHC'
|
description: 'If specified, enable-stack must be set. Will run stack setup to install the specified GHC'
|
||||||
|
outputs:
|
||||||
|
ghc-path:
|
||||||
|
description: 'The path of the ghc executable _directory_'
|
||||||
|
cabal-path:
|
||||||
|
description: 'The path of the cabal executable _directory_'
|
||||||
|
stack-path:
|
||||||
|
description: 'The path of the stack executable _directory_'
|
||||||
|
cabal-store:
|
||||||
|
description: 'The path to the cabal store'
|
||||||
|
ghc-exe:
|
||||||
|
description: 'The path of the ghc _executable_'
|
||||||
|
cabal-exe:
|
||||||
|
description: 'The path of the cabal _executable_'
|
||||||
|
stack-exe:
|
||||||
|
description: 'The path of the stack _executable_'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|||||||
5
dist/index.js
vendored
5
dist/index.js
vendored
@@ -2584,7 +2584,7 @@ function escapeProperty(s) {
|
|||||||
/***/ 447:
|
/***/ 447:
|
||||||
/***/ (function(module) {
|
/***/ (function(module) {
|
||||||
|
|
||||||
module.exports = {"ghc":["8.10.1","8.8.3","8.8.2","8.8.1","8.6.5","8.6.4","8.6.3","8.6.2","8.6.1","8.4.4","8.4.3","8.4.2","8.4.1","8.2.2","8.0.2","7.10.3"],"cabal":["3.0.0.0","2.4.1.0","2.4.0.0","2.2.0.0"],"stack":["2.1.3","2.1.1","1.9.3","1.9.1","1.7.1","1.6.5","1.6.3","1.6.1","1.5.1","1.5.0","1.4.0","1.3.2","1.3.0","1.2.0"]};
|
module.exports = {"ghc":["8.10.1","8.8.3","8.8.2","8.8.1","8.6.5","8.6.4","8.6.3","8.6.2","8.6.1","8.4.4","8.4.3","8.4.2","8.4.1","8.2.2","8.0.2","7.10.3"],"cabal":["3.2.0.0","3.0.0.0","2.4.1.0","2.4.0.0","2.2.0.0"],"stack":["2.1.3","2.1.1","1.9.3","1.9.1","1.7.1","1.6.5","1.6.3","1.6.1","1.5.1","1.5.0","1.4.0","1.3.2","1.3.0","1.2.0"]};
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -10757,7 +10757,8 @@ async function choco(tool, version) {
|
|||||||
}
|
}
|
||||||
async function ghcup(tool, version, os) {
|
async function ghcup(tool, version, os) {
|
||||||
core.info(`Attempting to install ${tool} ${version} using ghcup`);
|
core.info(`Attempting to install ${tool} ${version} using ghcup`);
|
||||||
const bin = await tc.downloadTool(`https://downloads.haskell.org/~ghcup/x86_64-${os === 'darwin' ? 'apple-darwin' : 'linux'}-ghcup`);
|
const v = '0.1.4';
|
||||||
|
const bin = await tc.downloadTool(`https://downloads.haskell.org/~ghcup/${v}/x86_64-${os === 'darwin' ? 'apple-darwin' : 'linux'}-ghcup-${v}`);
|
||||||
await fs_1.promises.chmod(bin, 0o755);
|
await fs_1.promises.chmod(bin, 0o755);
|
||||||
await exec_1.exec(bin, [tool === 'ghc' ? 'install' : 'install-cabal', version]);
|
await exec_1.exec(bin, [tool === 'ghc' ? 'install' : 'install-cabal', version]);
|
||||||
if (tool === 'ghc')
|
if (tool === 'ghc')
|
||||||
|
|||||||
@@ -178,10 +178,11 @@ async function choco(tool: Tool, version: string): Promise<void> {
|
|||||||
async function ghcup(tool: Tool, version: string, os: OS): Promise<void> {
|
async function ghcup(tool: Tool, version: string, os: OS): Promise<void> {
|
||||||
core.info(`Attempting to install ${tool} ${version} using ghcup`);
|
core.info(`Attempting to install ${tool} ${version} using ghcup`);
|
||||||
|
|
||||||
|
const v = '0.1.4';
|
||||||
const bin = await tc.downloadTool(
|
const bin = await tc.downloadTool(
|
||||||
`https://downloads.haskell.org/~ghcup/x86_64-${
|
`https://downloads.haskell.org/~ghcup/${v}/x86_64-${
|
||||||
os === 'darwin' ? 'apple-darwin' : 'linux'
|
os === 'darwin' ? 'apple-darwin' : 'linux'
|
||||||
}-ghcup`
|
}-ghcup-${v}`
|
||||||
);
|
);
|
||||||
await fs.chmod(bin, 0o755);
|
await fs.chmod(bin, 0o755);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user