Compare commits

...

28 Commits
v1.3.0 ... main

Author SHA1 Message Date
Fabio Niephaus
aef1f09405 Test against GraalVM for JDK 24 and 25 EA builds. 2025-03-18 17:03:35 +01:00
Alina Yurenko
26a86e7135 add about arm runners 2025-03-04 14:57:10 +01:00
Fabio Niephaus
01ed653ac8
Bump version to 1.3.3. 2025-03-03 14:23:11 +01:00
Joel Rudsberg
3ca6fc3a8a SBOM: Ensure 'java-version' is persisted to post-run phase 2025-03-03 12:56:54 +01:00
Fabio Niephaus
271a696e78 Bump version to 1.3.2. 2025-03-03 10:22:04 +01:00
Fabio Niephaus
2063b36b79 Update dist files. 2025-03-03 09:12:04 +01:00
Fabio Niephaus
44d0c2f19b Downgrade typescript back to 5.7.3.
eslint-plugin is not yet compatible with version `5.8.2` of typescript.
2025-03-03 09:12:04 +01:00
dependabot[bot]
26e3dc36fc Bump the npm-development group across 1 directory with 10 updates
Bumps the npm-development group with 10 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@eslint/compat](https://github.com/eslint/rewrite) | `1.2.6` | `1.2.7` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `20.17.17` | `20.17.22` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.24.0` | `8.25.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.24.0` | `8.25.0` |
| [eslint](https://github.com/eslint/eslint) | `9.20.1` | `9.21.0` |
| [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) | `10.0.1` | `10.0.2` |
| [eslint-import-resolver-typescript](https://github.com/import-js/eslint-import-resolver-typescript) | `3.7.0` | `3.8.3` |
| [prettier](https://github.com/prettier/prettier) | `3.5.0` | `3.5.3` |
| [ts-jest](https://github.com/kulshekhar/ts-jest) | `29.2.5` | `29.2.6` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.7.3` | `5.8.2` |



Updates `@eslint/compat` from 1.2.6 to 1.2.7
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json)
- [Commits](https://github.com/eslint/rewrite/compare/compat-v1.2.6...compat-v1.2.7)

Updates `@types/node` from 20.17.17 to 20.17.22
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 8.24.0 to 8.25.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.25.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.24.0 to 8.25.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.25.0/packages/parser)

Updates `eslint` from 9.20.1 to 9.21.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.20.1...v9.21.0)

Updates `eslint-config-prettier` from 10.0.1 to 10.0.2
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v10.0.1...v10.0.2)

Updates `eslint-import-resolver-typescript` from 3.7.0 to 3.8.3
- [Release notes](https://github.com/import-js/eslint-import-resolver-typescript/releases)
- [Changelog](https://github.com/import-js/eslint-import-resolver-typescript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-import-resolver-typescript/compare/v3.7.0...v3.8.3)

Updates `prettier` from 3.5.0 to 3.5.3
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.5.0...3.5.3)

Updates `ts-jest` from 29.2.5 to 29.2.6
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.2.5...v29.2.6)

Updates `typescript` from 5.7.3 to 5.8.2
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.3...v5.8.2)

---
updated-dependencies:
- dependency-name: "@eslint/compat"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: eslint-import-resolver-typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 09:12:04 +01:00
Fabio Niephaus
e6854f2a7c Update dist files. 2025-03-03 09:06:06 +01:00
dependabot[bot]
a1c06b5535 Bump @octokit/plugin-paginate-rest from 9.2.1 to 9.2.2
Bumps [@octokit/plugin-paginate-rest](https://github.com/octokit/plugin-paginate-rest.js) from 9.2.1 to 9.2.2.
- [Release notes](https://github.com/octokit/plugin-paginate-rest.js/releases)
- [Commits](https://github.com/octokit/plugin-paginate-rest.js/compare/v9.2.1...v9.2.2)

---
updated-dependencies:
- dependency-name: "@octokit/plugin-paginate-rest"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 09:06:06 +01:00
Fabio Niephaus
e4bdac3847 Update dist files. 2025-03-03 08:52:38 +01:00
dependabot[bot]
00f0f13934 Bump uuid from 11.0.5 to 11.1.0
Bumps [uuid](https://github.com/uuidjs/uuid) from 11.0.5 to 11.1.0.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v11.0.5...v11.1.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 08:52:38 +01:00
dependabot[bot]
63ca6fe724 Bump @actions/cache from 4.0.0 to 4.0.2 in the npm-production group
Bumps the npm-production group with 1 update: [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache).


Updates `@actions/cache` from 4.0.0 to 4.0.2
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

---
updated-dependencies:
- dependency-name: "@actions/cache"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 08:52:38 +01:00
dependabot[bot]
5b85983c0a Bump @octokit/request from 8.4.0 to 8.4.1
Bumps [@octokit/request](https://github.com/octokit/request.js) from 8.4.0 to 8.4.1.
- [Release notes](https://github.com/octokit/request.js/releases)
- [Commits](https://github.com/octokit/request.js/compare/v8.4.0...v8.4.1)

---
updated-dependencies:
- dependency-name: "@octokit/request"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 08:52:38 +01:00
Fabio Niephaus
f4c22e2c3f Update dist files. 2025-02-17 10:50:53 +01:00
dependabot[bot]
2ea5788b37 Bump @octokit/endpoint from 9.0.5 to 9.0.6
Bumps [@octokit/endpoint](https://github.com/octokit/endpoint.js) from 9.0.5 to 9.0.6.
- [Release notes](https://github.com/octokit/endpoint.js/releases)
- [Commits](https://github.com/octokit/endpoint.js/compare/v9.0.5...v9.0.6)

---
updated-dependencies:
- dependency-name: "@octokit/endpoint"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 10:50:53 +01:00
Fabio Niephaus
b5709ab80d Run SBOM test on ubuntu-22.04-arm. 2025-02-17 10:43:44 +01:00
Fabio Niephaus
6e1c9cebb5 Update dist files. 2025-02-17 10:43:44 +01:00
dependabot[bot]
601e3a4caa Bump @octokit/request-error from 5.1.0 to 5.1.1
Bumps [@octokit/request-error](https://github.com/octokit/request-error.js) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/octokit/request-error.js/releases)
- [Commits](https://github.com/octokit/request-error.js/compare/v5.1.0...v5.1.1)

---
updated-dependencies:
- dependency-name: "@octokit/request-error"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 10:43:44 +01:00
Fabio Niephaus
b0cb26a8da Bump version to 1.3.1. 2025-02-12 21:31:35 +01:00
Fabio Niephaus
30b157ff45 Ensure cache: 'maven' is tested. 2025-02-12 21:31:35 +01:00
Fabio Niephaus
0f761465f7 Convert back to CJS and use ncc. 2025-02-12 21:31:35 +01:00
Fabio Niephaus
f07b5bfaef Update dist files. 2025-02-12 14:38:09 +01:00
dependabot[bot]
fcc01ed19b Bump semver from 7.6.3 to 7.7.1
Dependabot couldn't find the original pull request head commit, d99c250780f60ae25820f76a799d34572762727f.
2025-02-12 14:38:09 +01:00
dependabot[bot]
c65e623881 Bump @octokit/types from 12.6.0 to 13.8.0
Bumps [@octokit/types](https://github.com/octokit/types.ts) from 12.6.0 to 13.8.0.
- [Release notes](https://github.com/octokit/types.ts/releases)
- [Commits](https://github.com/octokit/types.ts/compare/v12.6.0...v13.8.0)

---
updated-dependencies:
- dependency-name: "@octokit/types"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-12 14:23:45 +01:00
dependabot[bot]
3040d71541 Bump eslint-config-prettier from 9.1.0 to 10.0.1
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 9.1.0 to 10.0.1.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v9.1.0...v10.0.1)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-12 14:19:07 +01:00
Fabio Niephaus
70a5974953 Fix PASSES_GDS_TOKEN_CHECK. 2025-02-12 12:55:33 +01:00
dependabot[bot]
aa331906a0 Bump the npm-development group with 5 updates
Bumps the npm-development group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `20.17.14` | `20.17.17` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.22.0` | `8.24.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.22.0` | `8.24.0` |
| [eslint](https://github.com/eslint/eslint) | `9.19.0` | `9.20.1` |
| [prettier](https://github.com/prettier/prettier) | `3.4.2` | `3.5.0` |


Updates `@types/node` from 20.17.14 to 20.17.17
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 8.22.0 to 8.24.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.24.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.22.0 to 8.24.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.24.0/packages/parser)

Updates `eslint` from 9.19.0 to 9.20.1
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.19.0...v9.20.1)

Updates `prettier` from 3.4.2 to 3.5.0
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.4.2...3.5.0)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-12 12:55:33 +01:00
29 changed files with 129929 additions and 124361 deletions

View File

@ -41,7 +41,7 @@ jobs:
PASSES_GDS_TOKEN_CHECK: ${{ !matrix.set-gds-token || secrets.GDS_TOKEN != '' }}
strategy:
matrix:
java-version: ['23', '21', '17', '20', 'dev']
java-version: ['24', '21', '17', '20', 'dev']
distribution: ['graalvm', 'graalvm-community']
os: [
ubuntu-latest, # Linux on Intel
@ -56,7 +56,7 @@ jobs:
- java-version: 'latest-ea'
distribution: 'graalvm'
os: ubuntu-latest
- java-version: '24-ea'
- java-version: '25-ea'
distribution: 'graalvm'
os: ubuntu-latest
- java-version: '21'
@ -90,7 +90,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
components: ${{ matrix.components }}
gds-token: ${{ matrix.set-gds-token && secrets.GDS_TOKEN || '' }}
if: env.PASSES_GDS_TOKEN_CHECK
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
@ -103,14 +103,14 @@ jobs:
java --version
java --version | grep "GraalVM" || exit 34
native-image --version
if: runner.os != 'Windows' && env.PASSES_GDS_TOKEN_CHECK
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os != 'Windows' }}
- name: Check Windows environment
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME"
java --version
native-image --version
if: runner.os == 'Windows' && env.PASSES_GDS_TOKEN_CHECK
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os == 'Windows' }}
test-action-ce: # make sure the action works on a clean machine without building
needs: test-action
@ -172,7 +172,7 @@ jobs:
if [[ "${{ matrix.java-version }}" != "dev" ]]; then
gu list
fi
if: runner.os != 'Windows'
if: ${{ runner.os != 'Windows' }}
- name: Check Windows environment
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
@ -180,13 +180,16 @@ jobs:
java -version
native-image --version
gu.cmd remove native-image
if: runner.os == 'Windows'
if: ${{ runner.os == 'Windows' }}
test-action-ee:
needs: test-action
name: EE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
if: github.event_name != 'pull_request'
runs-on: ${{ matrix.os }}
env:
# Skip builds that require a GDS token but have no access to one (e.g., secrets are unavailable in PR runs)
PASSES_GDS_TOKEN_CHECK: ${{ secrets.GDS_TOKEN != '' }}
strategy:
matrix:
version: ['latest']
@ -212,6 +215,7 @@ jobs:
java-version: ${{ matrix.java-version }}
components: ${{ matrix.components }}
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
@ -221,7 +225,7 @@ jobs:
java --version | grep -e "GraalVM EE" -e "Oracle GraalVM" || exit 23
native-image --version
gu list
if: runner.os != 'Windows'
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os != 'Windows' }}
- name: Check Windows environment
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
@ -229,7 +233,7 @@ jobs:
java --version
native-image --version
gu.cmd remove native-image
if: runner.os == 'Windows'
if: ${{ env.PASSES_GDS_TOKEN_CHECK == 'true' && runner.os == 'Windows' }}
test-action-mandrel:
needs: test-action
@ -267,14 +271,14 @@ jobs:
java --version
java --version | grep "Temurin" || exit 23
native-image --version
if: runner.os != 'Windows'
if: ${{ runner.os != 'Windows' }}
- name: Check Windows environment
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME"
java --version
native-image --version
if: runner.os == 'Windows'
if: ${{ runner.os == 'Windows' }}
test-action-liberica:
needs: test-action
@ -303,7 +307,7 @@ jobs:
java --version | fgrep -qw ${{ matrix.java-version }} || exit 23
native-image --version
native-image --version | fgrep -qw ${{ matrix.java-version }} || exit 24
if: runner.os != 'Windows'
if: ${{ runner.os != 'Windows' }}
- name: Check Windows environment
shell: pwsh
run: |
@ -317,7 +321,7 @@ jobs:
if (!(native-image --version | findstr \<${{ matrix.java-version }}\>)) {
exit 24
}
if: runner.os == 'Windows'
if: ${{ runner.os == 'Windows' }}
test-action-native-image-windows:
name: native-image on windows-latest
@ -454,7 +458,7 @@ jobs:
matrix:
java-version: ['24-ea', 'latest-ea']
distribution: ['graalvm']
os: [macos-latest, windows-latest, ubuntu-latest]
os: [macos-latest, windows-latest, ubuntu-latest, ubuntu-22.04-arm]
components: ['']
steps:
- uses: actions/checkout@v4
@ -466,17 +470,18 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
components: ${{ matrix.components }}
native-image-enable-sbom: 'true'
cache: 'maven'
- name: Build Maven project and verify that SBOM was generated and its contents
run: |
cd __tests__/sbom/main-test-app
mvn --no-transfer-progress -Pnative package
bash verify-sbom.sh
shell: bash
if: runner.os != 'Windows'
if: ${{ runner.os != 'Windows' }}
- name: Build Maven project and verify that SBOM was generated and its contents (Windows)
run: |
cd __tests__\sbom\main-test-app
mvn --no-transfer-progress -Pnative package
cmd /c verify-sbom.cmd
shell: cmd
if: runner.os == 'Windows'
if: ${{ runner.os == 'Windows' }}

View File

@ -9,7 +9,7 @@ This action:
- exports a `$GRAALVM_HOME` environment variable
- adds `$GRAALVM_HOME/bin` to the `$PATH` environment variable<br>(Native Image, Truffle languages, and tools can be invoked directly)
- sets `$JAVA_HOME` to `$GRAALVM_HOME` by default<br>(can be disabled via `set-java-home: 'false'`, see [Options](#options))
- supports `x64` and `aarch64` (selected automatically, `aarch64` requires a [self-hosted runner][gha-self-hosted-runners])
- supports `x64` and `aarch64/arm64` (see how to use [Linux arm64 runners](https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/))
- supports dependency caching for Apache Maven, Gradle, and sbt (see [`cache` option](#options))
- sets up Windows environments with build tools using [vcvarsall.bat][vcvarsall]
- has built-in support for GraalVM components and the [GraalVM Updater][gu]

View File

@ -145,6 +145,7 @@ describe('sbom feature', () => {
writeFileSync(sbomPath, JSON.stringify(sbom, null, 2))
mockFindSBOM([sbomPath])
jest.spyOn(core, 'getState').mockReturnValue(javaVersion)
await processSBOM()
}
@ -190,6 +191,10 @@ describe('sbom feature', () => {
]
}
it('should throw an error if setUpSBOMSupport was not called before processSBOM', async () => {
await expect(processSBOM()).rejects.toThrow('setUpSBOMSupport must be called before processSBOM')
})
it('should process SBOM and display components', async () => {
await setUpAndProcessSBOM(sampleSBOM)

View File

@ -72,6 +72,6 @@ outputs:
description: 'A boolean value to indicate an exact match was found for the primary key'
runs:
using: 'node20'
main: 'dist/main.js'
post: 'dist/cleanup.js'
main: 'dist/main/index.js'
post: 'dist/cleanup/index.js'
post-if: 'success()'

1
dist/cleanup.js.map generated vendored

File diff suppressed because one or more lines are too long

126537
dist/main.js → dist/cleanup/index.js generated vendored

File diff suppressed because one or more lines are too long

1
dist/main.js.map generated vendored

File diff suppressed because one or more lines are too long

125276
dist/cleanup.js → dist/main/index.js generated vendored

File diff suppressed because one or more lines are too long

View File

@ -1,29 +1,14 @@
// See: https://jestjs.io/docs/configuration
/** @type {import('ts-jest').JestConfigWithTsJest} **/
export default {
module.exports = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: ['./src/**'],
coverageDirectory: './coverage',
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
coverageReporters: ['json-summary', 'text', 'lcov'],
extensionsToTreatAsEsm: ['.ts'],
moduleFileExtensions: ['ts', 'js'],
preset: 'ts-jest',
reporters: ['default'],
resolver: 'ts-jest-resolver',
testEnvironment: 'node',
moduleFileExtensions: ['js', 'ts'],
testMatch: ['**/*.test.ts'],
testPathIgnorePatterns: ['/dist/', '/node_modules/'],
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.eslint.json',
useESM: true
}
]
'^.+\\.ts$': 'ts-jest'
},
verbose: true
}

2205
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,8 +2,7 @@
"name": "setup-graalvm",
"author": "GraalVM Community",
"description": "GitHub Action for GraalVM",
"version": "1.3.0",
"type": "module",
"version": "1.3.3",
"private": true,
"repository": {
"type": "git",
@ -27,14 +26,14 @@
"format:check": "npx prettier --check .",
"lint": "npx eslint .",
"package": "npm run package:main && npm run package:cleanup",
"package:main": "npx rollup --config rollup.main.config.ts --configPlugin @rollup/plugin-typescript",
"package:cleanup": "npx rollup --config rollup.cleanup.config.ts --configPlugin @rollup/plugin-typescript",
"package:main": "npx ncc build src/main.ts -o dist/main",
"package:cleanup": "npx ncc build src/cleanup.ts -o dist/cleanup",
"test": "npx jest",
"all": "npm run format:write && npm run lint && npm run test && npm run package"
},
"license": "UPL",
"dependencies": {
"@actions/cache": "^4.0.0",
"@actions/cache": "^4.0.2",
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
@ -43,26 +42,23 @@
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.2",
"@octokit/core": "^5.2.0",
"@octokit/types": "^12.6.0",
"@octokit/types": "^13.8.0",
"@github/dependency-submission-toolkit": "^2.0.4",
"semver": "^7.6.3",
"uuid": "^11.0.5"
"semver": "^7.7.1",
"uuid": "^11.1.0"
},
"devDependencies": {
"@eslint/compat": "^1.2.6",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-typescript": "^12.1.1",
"@eslint/compat": "^1.2.7",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.12",
"@types/node": "^20.17.22",
"@types/semver": "^7.5.8",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.22.0",
"@typescript-eslint/parser": "^8.22.0",
"eslint": "^9.19.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"@typescript-eslint/eslint-plugin": "^8.25.0",
"@typescript-eslint/parser": "^8.25.0",
"@vercel/ncc": "^0.38.3",
"eslint": "^9.21.0",
"eslint-config-prettier": "^10.0.2",
"eslint-import-resolver-typescript": "^3.8.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.10.0",
"eslint-plugin-jsonc": "^2.19.1",
@ -70,15 +66,10 @@
"eslint-plugin-prettier": "^5.2.3",
"jest": "^29.7.0",
"js-yaml": "^4.1.0",
"prettier": "^3.4.2",
"prettier": "^3.5.3",
"prettier-eslint": "^16.3.0",
"rollup": "^4.34.1",
"ts-jest": "^29.2.5",
"ts-jest-resolver": "^2.0.1",
"ts-jest": "^29.2.6",
"ts-node": "^10.9.2",
"typescript": "^5.7.3"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "*"
}
}

View File

@ -1,19 +0,0 @@
// See: https://rollupjs.org/introduction/
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import nodeResolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
const config = {
input: 'src/cleanup.ts',
output: {
esModule: true,
file: 'dist/cleanup.js',
format: 'es',
sourcemap: true
},
plugins: [typescript(), nodeResolve(), commonjs(), json()]
}
export default config

View File

@ -1,19 +0,0 @@
// See: https://rollupjs.org/introduction/
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import nodeResolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
const config = {
input: 'src/main.ts',
output: {
esModule: true,
file: 'dist/main.js',
format: 'es',
sourcemap: true
},
plugins: [typescript(), nodeResolve(), commonjs(), json()]
}
export default config

View File

@ -25,10 +25,10 @@
*/
import * as core from '@actions/core'
import * as constants from './constants.js'
import { save } from './features/cache.js'
import { generateReports } from './features/reports.js'
import { processSBOM } from './features/sbom.js'
import * as constants from './constants'
import { save } from './features/cache'
import { generateReports } from './features/reports'
import { processSBOM } from './features/sbom'
/**
* Check given input and run a save process for the specified package manager

View File

@ -1,6 +1,6 @@
import * as otypes from '@octokit/types'
export const ACTION_VERSION = '1.3.0'
export const ACTION_VERSION = '1.3.3'
export const INPUT_VERSION = 'version'
export const INPUT_GDS_TOKEN = 'gds-token'

View File

@ -1,6 +1,6 @@
import * as core from '@actions/core'
import { GRAALVM_PLATFORM } from './constants.js'
import { exec } from './utils.js'
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<string, Map<string, string>>([

View File

@ -1,7 +1,7 @@
import * as c from '../constants.js'
import * as c from '../constants'
import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'
import { exec } from '../utils.js'
import { exec } from '../utils'
import { join } from 'path'
const MUSL_NAME = 'x86_64-linux-musl-native'

View File

@ -1,4 +1,4 @@
import * as c from '../constants.js'
import * as c from '../constants'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as github from '@actions/github'
@ -11,7 +11,7 @@ import {
updatePRComment,
tmpfile,
setNativeImageOption
} from '../utils.js'
} from '../utils'
const BUILD_OUTPUT_JSON_PATH = tmpfile('native-image-build-output.json')
const BYTES_TO_KiB = 1024

View File

@ -1,17 +1,16 @@
import * as c from '../constants.js'
import * as c from '../constants'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as github from '@actions/github'
import * as glob from '@actions/glob'
import { basename } from 'path'
import * as semver from 'semver'
import { setNativeImageOption } from '../utils.js'
import { setNativeImageOption } from '../utils'
const INPUT_NI_SBOM = 'native-image-enable-sbom'
const SBOM_FILE_SUFFIX = '.sbom.json'
const MIN_JAVA_VERSION = '24.0.0'
let javaVersionOrLatestEA: string | null = null
const javaVersionKey = 'javaVersionKey'
interface SBOM {
components: Component[]
@ -67,36 +66,36 @@ interface DependencySnapshot {
>
}
export function setUpSBOMSupport(javaVersionOrDev: string, distribution: string): void {
export function setUpSBOMSupport(javaVersion: string, distribution: string): void {
if (!isFeatureEnabled()) {
return
}
validateJavaVersionAndDistribution(javaVersionOrDev, distribution)
javaVersionOrLatestEA = javaVersionOrDev
setNativeImageOption(javaVersionOrLatestEA, '--enable-sbom=export')
validateJavaVersionAndDistribution(javaVersion, distribution)
core.saveState(javaVersionKey, javaVersion)
setNativeImageOption(javaVersion, '--enable-sbom=export')
core.info('Enabled SBOM generation for Native Image build')
}
function validateJavaVersionAndDistribution(javaVersionOrDev: string, distribution: string): void {
function validateJavaVersionAndDistribution(javaVersion: string, distribution: string): void {
if (distribution !== c.DISTRIBUTION_GRAALVM) {
throw new Error(
`The '${INPUT_NI_SBOM}' option is only supported for Oracle GraalVM (distribution '${c.DISTRIBUTION_GRAALVM}'), but found distribution '${distribution}'.`
)
}
if (javaVersionOrDev === 'dev') {
if (javaVersion === 'dev') {
throw new Error(`The '${INPUT_NI_SBOM}' option is not supported for java-version 'dev'.`)
}
if (javaVersionOrDev === 'latest-ea') {
if (javaVersion === 'latest-ea') {
return
}
const coercedJavaVersion = semver.coerce(javaVersionOrDev)
const coercedJavaVersion = semver.coerce(javaVersion)
if (!coercedJavaVersion || semver.gt(MIN_JAVA_VERSION, coercedJavaVersion)) {
throw new Error(
`The '${INPUT_NI_SBOM}' option is only supported for GraalVM for JDK ${MIN_JAVA_VERSION} or later, but found java-version '${javaVersionOrDev}'.`
`The '${INPUT_NI_SBOM}' option is only supported for GraalVM for JDK ${MIN_JAVA_VERSION} or later, but found java-version '${javaVersion}'.`
)
}
}
@ -106,7 +105,8 @@ export async function processSBOM(): Promise<void> {
return
}
if (javaVersionOrLatestEA === null) {
const javaVersion = core.getState(javaVersionKey)
if (!javaVersion) {
throw new Error('setUpSBOMSupport must be called before processSBOM')
}
@ -116,7 +116,7 @@ export async function processSBOM(): Promise<void> {
const sbomData = parseSBOM(sbomContent)
const components = mapToComponentsWithDependencies(sbomData)
printSBOMContent(components)
const snapshot = convertSBOMToSnapshot(sbomPath, components)
const snapshot = convertSBOMToSnapshot(javaVersion, sbomPath, components)
await submitDependencySnapshot(snapshot)
} catch (error) {
throw new Error(
@ -184,7 +184,7 @@ function printSBOMContent(components: Component[]): void {
core.info('==================')
}
function convertSBOMToSnapshot(sbomPath: string, components: Component[]): DependencySnapshot {
function convertSBOMToSnapshot(javaVersion: string, sbomPath: string, components: Component[]): DependencySnapshot {
const context = github.context
const sbomFileName = basename(sbomPath)
@ -203,7 +203,7 @@ function convertSBOMToSnapshot(sbomPath: string, components: Component[]): Depen
},
detector: {
name: 'Oracle GraalVM',
version: javaVersionOrLatestEA ?? '',
version: javaVersion,
url: 'https://www.graalvm.org/'
},
scanned: new Date().toISOString(),

View File

@ -1,4 +1,4 @@
import * as c from './constants.js'
import * as c from './constants'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as httpClient from '@actions/http-client'
@ -8,8 +8,8 @@ import * as stream from 'stream'
import * as util from 'util'
import * as semver from 'semver'
import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'
import { RetryHelper } from '@actions/tool-cache/lib/retry-helper.js'
import { calculateSHA256 } from './utils.js'
import { RetryHelper } from '@actions/tool-cache/lib/retry-helper'
import { calculateSHA256 } from './utils'
import { ok } from 'assert'
import { v4 as uuidv4 } from 'uuid'

View File

@ -1,4 +1,4 @@
import * as c from './constants.js'
import * as c from './constants'
import * as core from '@actions/core'
import * as semver from 'semver'
import {
@ -8,8 +8,8 @@ import {
getLatestRelease,
getMatchingTags,
getTaggedRelease
} from './utils.js'
import { downloadGraalVM, downloadGraalVMEELegacy } from './gds.js'
} from './utils'
import { downloadGraalVM, downloadGraalVMEELegacy } from './gds'
import { downloadTool } from '@actions/tool-cache'
import { basename } from 'path'

View File

@ -1,8 +1,8 @@
import * as c from './constants.js'
import * as c from './constants'
import * as core from '@actions/core'
import * as semver from 'semver'
import { GRAALVM_PLATFORM } from './constants.js'
import { exec } from './utils.js'
import { GRAALVM_PLATFORM } from './constants'
import { exec } from './utils'
import { join } from 'path'
const BASE_FLAGS = ['--non-interactive', 'install', '--no-progress']

View File

@ -1,6 +1,6 @@
import * as c from './constants.js'
import * as c from './constants'
import * as semver from 'semver'
import { downloadExtractAndCacheJDK, getTaggedRelease, getMatchingTags } from './utils.js'
import { downloadExtractAndCacheJDK, getTaggedRelease, getMatchingTags } from './utils'
import { downloadTool } from '@actions/tool-cache'
import { spawnSync } from 'child_process'

View File

@ -1,20 +1,20 @@
import * as c from './constants.js'
import * as c from './constants'
import * as core from '@actions/core'
import * as graalvm from './graalvm.js'
import * as graalvm from './graalvm'
import * as semver from 'semver'
import { isFeatureAvailable as isCacheAvailable } from '@actions/cache'
import { basename, join } from 'path'
import { restore } from './features/cache.js'
import { setUpDependencies } from './dependencies.js'
import { setUpGUComponents } from './gu.js'
import { setUpMandrel } from './mandrel.js'
import { setUpLiberica } from './liberica.js'
import { checkForUpdates } from './features/check-for-updates.js'
import { setUpNativeImageMusl } from './features/musl.js'
import { setUpWindowsEnvironment } from './msvc.js'
import { setUpNativeImageBuildReports } from './features/reports.js'
import { restore } from './features/cache'
import { setUpDependencies } from './dependencies'
import { setUpGUComponents } from './gu'
import { setUpMandrel } from './mandrel'
import { setUpLiberica } from './liberica'
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'
import { setUpSBOMSupport } from './features/sbom.js'
import { setUpSBOMSupport } from './features/sbom'
async function run(): Promise<void> {
try {

View File

@ -1,6 +1,6 @@
import * as c from './constants.js'
import * as c from './constants'
import * as httpClient from '@actions/http-client'
import { downloadExtractAndCacheJDK } from './utils.js'
import { downloadExtractAndCacheJDK } from './utils'
import { downloadTool } from '@actions/tool-cache'
import { basename } from 'path'

View File

@ -1,7 +1,7 @@
import * as core from '@actions/core'
import { execSync } from 'child_process'
import { existsSync } from 'fs'
import { VERSION_DEV } from './constants.js'
import { VERSION_DEV } from './constants'
// Keep in sync with https://github.com/actions/virtual-environments
const KNOWN_VISUAL_STUDIO_INSTALLATIONS = [

View File

@ -1,4 +1,4 @@
import * as c from './constants.js'
import * as c from './constants'
import * as core from '@actions/core'
import * as github from '@actions/github'
import * as httpClient from '@actions/http-client'

View File

@ -15,6 +15,7 @@
"noUnusedParameters": false,
"pretty": true,
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
"strictNullChecks": true,
"target": "ES2022"

View File

@ -6,12 +6,5 @@
"noEmit": true
},
"exclude": ["dist", "node_modules"],
"include": [
"__tests__",
"src",
"eslint.config.mjs",
"jest.config.js",
"rollup.cleanup.config.ts",
"rollup.main.config.ts"
]
"include": ["__tests__", "src", "eslint.config.mjs", "jest.config.js"]
}