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

29 lines
798 B
TypeScript
Raw Normal View History

import * as core from '@actions/core';
import {findHaskellGHCVersion, findHaskellCabalVersion} from './installer';
// ghc and cabal are installed directly to /opt so use that directlly instead of
// copying over to the toolcache dir.
const baseInstallDir = '/opt';
2019-09-23 20:32:15 -07:00
const defaultGHCVersion = '8.6.5';
const defaultCabalVersion = '3.0';
2019-09-23 20:32:15 -07:00
async function run() {
try {
let ghcVersion = core.getInput('ghc-version');
2019-09-23 20:32:15 -07:00
if (!ghcVersion) {
ghcVersion = defaultGHCVersion;
}
2019-09-30 11:20:46 -07:00
findHaskellGHCVersion(baseInstallDir, 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 = defaultCabalVersion;
2019-09-23 20:32:15 -07:00
}
2019-09-30 11:20:46 -07:00
findHaskellCabalVersion(baseInstallDir, cabalVersion);
} catch (error) {
core.setFailed(error.message);
}
}
run();