import * as core from '@actions/core' import {GRAALVM_PLATFORM} from './constants' import {exec} from './utils' const APT_GET_INSTALL_BASE = 'sudo apt-get -y --no-upgrade install' const COMPONENT_TO_DEPS = new Map>([ [ 'linux', new Map([ ['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([['ruby', 'brew install openssl']])] ]) export async function setUpDependencies(components: string[]): Promise { 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() } } } }