Allow setting cabal version too
This commit is contained in:
@@ -17,10 +17,16 @@ export async function cacheHaskellTool(installDir: string, tool: string) {
|
||||
}
|
||||
|
||||
export async function findHaskellGHCVersion(version: string) {
|
||||
if (!version) {
|
||||
version = '8.6.5';
|
||||
}
|
||||
return _findHaskellToolVersion('ghc', version);
|
||||
}
|
||||
|
||||
export async function findHaskellCabalVersion(version: string) {
|
||||
if (!version) {
|
||||
version = '3.0';
|
||||
}
|
||||
return _findHaskellToolVersion('cabal', version);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import * as core from '@actions/core';
|
||||
import {findHaskellGHCVersion, cacheHaskellTool} from './installer';
|
||||
import {
|
||||
findHaskellGHCVersion,
|
||||
findHaskellCabalVersion,
|
||||
cacheHaskellTool
|
||||
} from './installer';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
@@ -7,6 +11,9 @@ async function run() {
|
||||
await cacheHaskellTool('/opt', 'cabal');
|
||||
let ghcVersion = core.getInput('ghc-version');
|
||||
await findHaskellGHCVersion(ghcVersion);
|
||||
|
||||
let cabalVersion = core.getInput('cabal-version');
|
||||
await findHaskellCabalVersion(cabalVersion);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user