Files
setup-haskell/src/setup-haskell.ts

33 lines
743 B
TypeScript
Raw Normal View History

import * as core from '@actions/core';
2019-09-23 20:07:29 -07:00
import {
findHaskellGHCVersion,
findHaskellCabalVersion,
cacheHaskellTool
} from './installer';
2019-09-23 20:32:15 -07:00
const defaultGHCVersion = '8.6.5';
const defualtCabalVersion = '3.0';
async function run() {
try {
await cacheHaskellTool('/opt', 'ghc');
await cacheHaskellTool('/opt', 'cabal');
2019-09-23 20:32:15 -07:00
let ghcVersion = core.getInput('ghc-version');
2019-09-23 20:32:15 -07:00
if (!ghcVersion) {
ghcVersion = defaultGHCVersion;
}
await findHaskellGHCVersion(ghcVersion);
2019-09-23 20:07:29 -07:00
let cabalVersion = core.getInput('cabal-version');
2019-09-23 20:32:15 -07:00
if (!cabalVersion) {
cabalVersion = defualtCabalVersion;
}
2019-09-23 20:07:29 -07:00
await findHaskellCabalVersion(cabalVersion);
} catch (error) {
core.setFailed(error.message);
}
}
run();