Skip to content
Merged
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
8 changes: 7 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.expect-fail }}
strategy:
fail-fast: false
fail-fast: true
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc: ['latest', '8.4.4']
Expand All @@ -54,20 +54,26 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./
continue-on-error: ${{ matrix.expect-fail }}
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: |
runhaskell --version
runhaskell __tests__/hello.hs
continue-on-error: ${{ matrix.expect-fail }}
- working-directory: __tests__/project
run: cabal build && cabal run
continue-on-error: ${{ matrix.expect-fail }}
- working-directory: __tests__/project
run: cabal run
continue-on-error: ${{ matrix.expect-fail }}
- run: |
cabal --version
ghc --version
continue-on-error: ${{ matrix.expect-fail }}
- shell: bash
continue-on-error: ${{ matrix.expect-fail }}
if: matrix.ghc != 'latest'
# this check depends on the ghc versions being "exact" in the matrix
run: |
Expand Down
7 changes: 5 additions & 2 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
'!(*test).{js,ts}': 'eslint --cache --fix',
'!(*test).ts': () => ['ncc build', 'git add dist'],
'!(*test).{js,ts}': [
'eslint --cache --fix',
() => 'ncc build',
() => 'git add dist'
],
'src/**/*.ts': () => 'tsc -p tsconfig.json',
'*.{js,ts,json,md}': 'prettier --write'
};
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,13 @@ jobs:
| Name | Description | Type |
| ------------- | -------------------------------------------- | ------ |
| `ghc-path` | The path of the ghc executable _directory_ | string |
| `cabal-path` | The path of the cabal executable _directory_ | string |
| `stack-path` | The path of the stack executable _directory_ | string |
| `cabal-store` | The path to the cabal store | string |
| `ghc-exe` | The path of the ghc _executable_ | string |
| `cabal-path` | The path of the cabal executable _directory_ | string |
| `cabal-exe` | The path of the cabal _executable_ | string |
| `cabal-store` | The path to the cabal store | string |
| `stack-path` | The path of the stack executable _directory_ | string |
| `stack-exe` | The path of the stack _executable_ | string |
| `stack-root` | The path to the stack root | string |

## Version Support

Expand Down Expand Up @@ -159,7 +160,7 @@ Recommendation: Use the latest available version if possible.
**Stack:**

- `latest` (recommended) -- follows the latest release automatically.
- `2.3.1` `2.3`
- `2.3.3` `2.3`
- `2.3.1`
- `2.1.3` `2.1`
- `2.1.1`
Expand Down
14 changes: 8 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ inputs:
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-path:
description: 'The path of the cabal executable _directory_'
cabal-exe:
description: 'The path of the cabal _executable_'
cabal-store:
description: 'The path to the cabal store'
stack-path:
description: 'The path of the stack executable _directory_'
stack-exe:
description: 'The path of the stack _executable_'
stack-root:
description: 'The path to the stack root'
runs:
using: 'node12'
main: 'dist/index.js'
14 changes: 8 additions & 6 deletions dist/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ inputs:
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-path:
description: 'The path of the cabal executable _directory_'
cabal-exe:
description: 'The path of the cabal _executable_'
cabal-store:
description: 'The path to the cabal store'
stack-path:
description: 'The path of the stack executable _directory_'
stack-exe:
description: 'The path of the stack _executable_'
stack-root:
description: 'The path to the stack root'
runs:
using: 'node12'
main: 'dist/index.js'
30 changes: 21 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Expand Down Expand Up @@ -4338,7 +4338,7 @@ function escapeProperty(s) {
/***/ 447:
/***/ (function(module) {

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"]};
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"]};

/***/ }),

Expand Down Expand Up @@ -8744,7 +8744,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Expand Down Expand Up @@ -11008,7 +11008,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Expand All @@ -11024,10 +11024,22 @@ const path_1 = __webpack_require__(622);
function failed(tool, version) {
throw new Error(`All install methods for ${tool} ${version} failed`);
}
async function success(tool, version, path) {
core.addPath(path);
async function configureOutputs(tool, path, os) {
core.setOutput(`${tool}-path`, path);
core.setOutput(`${tool}-exe`, await io_1.which(tool));
if (tool == 'stack') {
if (os === 'win32') {
core.exportVariable('STACK_ROOT', 'C:\\sr');
core.setOutput('stack-root', 'C:\\sr');
}
else {
core.setOutput('stack-root', `${process.env.HOME}/.stack`);
}
}
}
async function success(tool, version, path, os) {
core.addPath(path);
await configureOutputs(tool, path, os);
core.info(`Found ${tool} ${version} in cache at path ${path}. Setup successful.`);
return true;
}
Expand All @@ -11047,7 +11059,7 @@ function warn(tool, version) {
async function isInstalled(tool, version, os) {
const toolPath = tc.find(tool, version);
if (toolPath)
return success(tool, version, toolPath);
return success(tool, version, toolPath, os);
const ghcupPath = `${process.env.HOME}/.ghcup${tool === 'ghc' ? `/ghc/${version}` : ''}/bin`;
const v = tool === 'cabal' ? version.slice(0, 3) : version;
const aptPath = `/opt/${tool}/${v}/bin`;
Expand Down Expand Up @@ -11075,7 +11087,7 @@ async function isInstalled(tool, version, os) {
// default prior to this action being ran.
if (tool === 'ghc' && installedPath === ghcupPath)
await exec_1.exec(await ghcupBin(os), ['set', version]);
return success(tool, version, installedPath);
return success(tool, version, installedPath, os);
}
}
if (tool === 'cabal' && os !== 'win32') {
Expand All @@ -11084,7 +11096,7 @@ async function isInstalled(tool, version, os) {
.then(() => ghcupPath)
.catch(() => undefined);
if (installedPath)
return success(tool, version, installedPath);
return success(tool, version, installedPath, os);
}
return false;
}
Expand Down
Loading