Skip to content

Commit

Permalink
Report java --version when done.
Browse files Browse the repository at this point in the history
Fixes #81
  • Loading branch information
fniephaus committed Feb 22, 2024
1 parent 0fee1ab commit bd9c75c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/cleanup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const IS_LINUX = process.platform === 'linux'
export const IS_MACOS = process.platform === 'darwin'
export const IS_WINDOWS = process.platform === 'win32'

export const EXECUTABLE_SUFFIX = IS_WINDOWS ? '.exe' : ''

export const DISTRIBUTION_GRAALVM = 'graalvm'
export const DISTRIBUTION_GRAALVM_COMMUNITY = 'graalvm-community'
export const DISTRIBUTION_MANDREL = 'mandrel'
Expand Down
9 changes: 8 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as core from '@actions/core'
import * as graalvm from './graalvm'
import * as semver from 'semver'
import {isFeatureAvailable as isCacheAvailable} from '@actions/cache'
import {join} from 'path'
import {basename, join} from 'path'
import {restore} from './features/cache'
import {setUpDependencies} from './dependencies'
import {setUpGUComponents} from './gu'
Expand All @@ -12,6 +12,7 @@ import {checkForUpdates} from './features/check-for-updates'
import {setUpNativeImageMusl} from './features/musl'
import {setUpWindowsEnvironment} from './msvc'
import {setUpNativeImageBuildReports} from './features/reports'
import {exec} from '@actions/exec'

async function run(): Promise<void> {
try {
Expand Down Expand Up @@ -151,6 +152,12 @@ async function run(): Promise<void> {
await restore(cache)
}
setUpNativeImageBuildReports(isGraalVMforJDK17OrLater, graalVMVersion)

core.startGroup(`Successfully set up '${basename(graalVMHome)}'`)
await exec(join(graalVMHome, 'bin', `java${c.EXECUTABLE_SUFFIX}`), [
'--version'
])
core.endGroup()
} catch (error) {
if (error instanceof Error) core.setFailed(error.message)
}
Expand Down

0 comments on commit bd9c75c

Please sign in to comment.