mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-01-19 03:43:02 +08:00
Set up dependencies.
This commit is contained in:
parent
a1ee297bf2
commit
c26d35376d
33
src/dependencies.ts
Normal file
33
src/dependencies.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import * as core from '@actions/core'
|
||||
import {GRAALVM_PLATFORM} from './constants'
|
||||
import {exec} from '@actions/exec'
|
||||
|
||||
const APT_GET_INSTALL_BASE = 'sudo apt-get -y --no-upgrade install'
|
||||
const COMPONENT_TO_DEPS = new Map<string, Map<string, string>>([
|
||||
[
|
||||
'linux',
|
||||
new Map<string, string>([
|
||||
['nodejs', `${APT_GET_INSTALL_BASE} g++ make`],
|
||||
['ruby', `${APT_GET_INSTALL_BASE} make gcc libssl-dev libz-dev`],
|
||||
[
|
||||
'R',
|
||||
`${APT_GET_INSTALL_BASE} libgomp1 build-essential gfortran libxml2 libc++-dev`
|
||||
]
|
||||
])
|
||||
],
|
||||
['darwin', new Map<string, string>([['ruby', 'brew install openssl']])]
|
||||
])
|
||||
|
||||
export async function setUpDependencies(components: string[]): Promise<void> {
|
||||
const platformDeps = COMPONENT_TO_DEPS.get(GRAALVM_PLATFORM)
|
||||
if (platformDeps) {
|
||||
for (const component of components) {
|
||||
const depCommand = platformDeps.get(component)
|
||||
if (depCommand) {
|
||||
core.startGroup(`Installing dependencies for ${component}...`)
|
||||
await exec(depCommand)
|
||||
core.endGroup()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ import * as core from '@actions/core'
|
||||
import * as graalvm from './graalvm'
|
||||
import {join} from 'path'
|
||||
import {mkdirP} from '@actions/io'
|
||||
import {setUpDependencies} from './dependencies'
|
||||
import {setUpGraalVMTrunk} from './graalvm-trunk'
|
||||
import {setUpWindowsEnvironment} from './msvc'
|
||||
|
||||
@ -18,6 +19,7 @@ async function run(): Promise<void> {
|
||||
if (c.IS_WINDOWS) {
|
||||
setUpWindowsEnvironment()
|
||||
}
|
||||
setUpDependencies(components)
|
||||
|
||||
await mkdirP(c.GRAALVM_BASE)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user