Skip to content

Commit 809327a

Browse files
author
Jared Weakly
authored
Avh4 prs (#7)
* Add stack 2.3.3 * Upgrade dependencies to fix lint-staged * Add stack-root
1 parent 82e74f7 commit 809327a

10 files changed

Lines changed: 947 additions & 824 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ${{ matrix.os }}
3434
continue-on-error: ${{ matrix.expect-fail }}
3535
strategy:
36-
fail-fast: false
36+
fail-fast: true
3737
matrix:
3838
os: [ubuntu-latest, macOS-latest, windows-latest]
3939
ghc: ['latest', '8.4.4']
@@ -54,20 +54,26 @@ jobs:
5454
steps:
5555
- uses: actions/checkout@v2
5656
- uses: ./
57+
continue-on-error: ${{ matrix.expect-fail }}
5758
with:
5859
ghc-version: ${{ matrix.ghc }}
5960
cabal-version: ${{ matrix.cabal }}
6061
- run: |
6162
runhaskell --version
6263
runhaskell __tests__/hello.hs
64+
continue-on-error: ${{ matrix.expect-fail }}
6365
- working-directory: __tests__/project
6466
run: cabal build && cabal run
67+
continue-on-error: ${{ matrix.expect-fail }}
6568
- working-directory: __tests__/project
6669
run: cabal run
70+
continue-on-error: ${{ matrix.expect-fail }}
6771
- run: |
6872
cabal --version
6973
ghc --version
74+
continue-on-error: ${{ matrix.expect-fail }}
7075
- shell: bash
76+
continue-on-error: ${{ matrix.expect-fail }}
7177
if: matrix.ghc != 'latest'
7278
# this check depends on the ghc versions being "exact" in the matrix
7379
run: |

.lintstagedrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
2-
'!(*test).{js,ts}': 'eslint --cache --fix',
3-
'!(*test).ts': () => ['ncc build', 'git add dist'],
2+
'!(*test).{js,ts}': [
3+
'eslint --cache --fix',
4+
() => 'ncc build',
5+
() => 'git add dist'
6+
],
47
'src/**/*.ts': () => 'tsc -p tsconfig.json',
58
'*.{js,ts,json,md}': 'prettier --write'
69
};

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,13 @@ jobs:
112112
| Name | Description | Type |
113113
| ------------- | -------------------------------------------- | ------ |
114114
| `ghc-path` | The path of the ghc executable _directory_ | string |
115-
| `cabal-path` | The path of the cabal executable _directory_ | string |
116-
| `stack-path` | The path of the stack executable _directory_ | string |
117-
| `cabal-store` | The path to the cabal store | string |
118115
| `ghc-exe` | The path of the ghc _executable_ | string |
116+
| `cabal-path` | The path of the cabal executable _directory_ | string |
119117
| `cabal-exe` | The path of the cabal _executable_ | string |
118+
| `cabal-store` | The path to the cabal store | string |
119+
| `stack-path` | The path of the stack executable _directory_ | string |
120120
| `stack-exe` | The path of the stack _executable_ | string |
121+
| `stack-root` | The path to the stack root | string |
121122

122123
## Version Support
123124

@@ -159,7 +160,7 @@ Recommendation: Use the latest available version if possible.
159160
**Stack:**
160161

161162
- `latest` (recommended) -- follows the latest release automatically.
162-
- `2.3.1` `2.3`
163+
- `2.3.3` `2.3`
163164
- `2.3.1`
164165
- `2.1.3` `2.1`
165166
- `2.1.1`

action.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@ inputs:
2626
outputs:
2727
ghc-path:
2828
description: 'The path of the ghc executable _directory_'
29-
cabal-path:
30-
description: 'The path of the cabal executable _directory_'
31-
stack-path:
32-
description: 'The path of the stack executable _directory_'
33-
cabal-store:
34-
description: 'The path to the cabal store'
3529
ghc-exe:
3630
description: 'The path of the ghc _executable_'
31+
cabal-path:
32+
description: 'The path of the cabal executable _directory_'
3733
cabal-exe:
3834
description: 'The path of the cabal _executable_'
35+
cabal-store:
36+
description: 'The path to the cabal store'
37+
stack-path:
38+
description: 'The path of the stack executable _directory_'
3939
stack-exe:
4040
description: 'The path of the stack _executable_'
41+
stack-root:
42+
description: 'The path to the stack root'
4143
runs:
4244
using: 'node12'
4345
main: 'dist/index.js'

dist/action.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@ inputs:
2626
outputs:
2727
ghc-path:
2828
description: 'The path of the ghc executable _directory_'
29-
cabal-path:
30-
description: 'The path of the cabal executable _directory_'
31-
stack-path:
32-
description: 'The path of the stack executable _directory_'
33-
cabal-store:
34-
description: 'The path to the cabal store'
3529
ghc-exe:
3630
description: 'The path of the ghc _executable_'
31+
cabal-path:
32+
description: 'The path of the cabal executable _directory_'
3733
cabal-exe:
3834
description: 'The path of the cabal _executable_'
35+
cabal-store:
36+
description: 'The path to the cabal store'
37+
stack-path:
38+
description: 'The path of the stack executable _directory_'
3939
stack-exe:
4040
description: 'The path of the stack _executable_'
41+
stack-root:
42+
description: 'The path to the stack root'
4143
runs:
4244
using: 'node12'
4345
main: 'dist/index.js'

dist/index.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
863863
var __importStar = (this && this.__importStar) || function (mod) {
864864
if (mod && mod.__esModule) return mod;
865865
var result = {};
866-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
866+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
867867
__setModuleDefault(result, mod);
868868
return result;
869869
};
@@ -4338,7 +4338,7 @@ function escapeProperty(s) {
43384338
/***/ 447:
43394339
/***/ (function(module) {
43404340

4341-
module.exports = {"ghc":["8.10.2","8.10.1","8.8.4","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.3.1","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"]};
4341+
module.exports = {"ghc":["8.10.2","8.10.1","8.8.4","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.3.3","2.3.1","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"]};
43424342

43434343
/***/ }),
43444344

@@ -8744,7 +8744,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
87448744
var __importStar = (this && this.__importStar) || function (mod) {
87458745
if (mod && mod.__esModule) return mod;
87468746
var result = {};
8747-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
8747+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
87488748
__setModuleDefault(result, mod);
87498749
return result;
87508750
};
@@ -11008,7 +11008,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
1100811008
var __importStar = (this && this.__importStar) || function (mod) {
1100911009
if (mod && mod.__esModule) return mod;
1101011010
var result = {};
11011-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11011+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1101211012
__setModuleDefault(result, mod);
1101311013
return result;
1101411014
};
@@ -11024,10 +11024,22 @@ const path_1 = __webpack_require__(622);
1102411024
function failed(tool, version) {
1102511025
throw new Error(`All install methods for ${tool} ${version} failed`);
1102611026
}
11027-
async function success(tool, version, path) {
11028-
core.addPath(path);
11027+
async function configureOutputs(tool, path, os) {
1102911028
core.setOutput(`${tool}-path`, path);
1103011029
core.setOutput(`${tool}-exe`, await io_1.which(tool));
11030+
if (tool == 'stack') {
11031+
if (os === 'win32') {
11032+
core.exportVariable('STACK_ROOT', 'C:\\sr');
11033+
core.setOutput('stack-root', 'C:\\sr');
11034+
}
11035+
else {
11036+
core.setOutput('stack-root', `${process.env.HOME}/.stack`);
11037+
}
11038+
}
11039+
}
11040+
async function success(tool, version, path, os) {
11041+
core.addPath(path);
11042+
await configureOutputs(tool, path, os);
1103111043
core.info(`Found ${tool} ${version} in cache at path ${path}. Setup successful.`);
1103211044
return true;
1103311045
}
@@ -11047,7 +11059,7 @@ function warn(tool, version) {
1104711059
async function isInstalled(tool, version, os) {
1104811060
const toolPath = tc.find(tool, version);
1104911061
if (toolPath)
11050-
return success(tool, version, toolPath);
11062+
return success(tool, version, toolPath, os);
1105111063
const ghcupPath = `${process.env.HOME}/.ghcup${tool === 'ghc' ? `/ghc/${version}` : ''}/bin`;
1105211064
const v = tool === 'cabal' ? version.slice(0, 3) : version;
1105311065
const aptPath = `/opt/${tool}/${v}/bin`;
@@ -11075,7 +11087,7 @@ async function isInstalled(tool, version, os) {
1107511087
// default prior to this action being ran.
1107611088
if (tool === 'ghc' && installedPath === ghcupPath)
1107711089
await exec_1.exec(await ghcupBin(os), ['set', version]);
11078-
return success(tool, version, installedPath);
11090+
return success(tool, version, installedPath, os);
1107911091
}
1108011092
}
1108111093
if (tool === 'cabal' && os !== 'win32') {
@@ -11084,7 +11096,7 @@ async function isInstalled(tool, version, os) {
1108411096
.then(() => ghcupPath)
1108511097
.catch(() => undefined);
1108611098
if (installedPath)
11087-
return success(tool, version, installedPath);
11099+
return success(tool, version, installedPath, os);
1108811100
}
1108911101
return false;
1109011102
}

0 commit comments

Comments
 (0)