• Stars
    star
    190
  • Rank 203,739 (Top 5 %)
  • Language
    TypeScript
  • License
    Universal Permiss...
  • Created almost 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GitHub Action for setting up GraalVM distributions.

GitHub Action for GraalVM build-test

This GitHub action sets up GraalVM Community Edition (CE) or Enterprise Edition (EE) as well as GraalVM components such as Native Image and Truffle languages.

Key Features

This action:

  • supports GraalVM Community Edition (CE) releases, dev builds, GraalVM Enterprise Edition (EE) releases (set gds-token) 22.1.0 and later, and Mandrel (see options)
  • has built-in support for GraalVM components and the GraalVM Updater
  • exports a $GRAALVM_HOME environment variable
  • adds $GRAALVM_HOME/bin to the $PATH environment variable
    (Truffle languages and tools can be invoked directly)
  • sets $JAVA_HOME to $GRAALVM_HOME by default
    (can be disabled via set-java-home: 'false', see options)
  • supports amd64 and aarch64 (selected automatically, aarch64 requires a self-hosted runner)
  • sets up Windows environments with build tools using vcvarsall.bat
  • supports dependency caching for Apache Maven, Gradle, and sbt (see cache option)

Templates

Quickstart Template

name: GraalVM Community Edition build
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: graalvm/setup-graalvm@v1
        with:
          version: 'latest'
          java-version: '17'
          components: 'native-image'
          github-token: ${{ secrets.GITHUB_TOKEN }}
      - name: Example step
        run: |
          echo "GRAALVM_HOME: $GRAALVM_HOME"
          echo "JAVA_HOME: $JAVA_HOME"
          java --version
          gu --version
          native-image --version

Building a HelloWorld with GraalVM Native Image on Different Platforms

name: GraalVM Native Image builds
on: [push, pull_request]
jobs:
  build:
    name: HelloWorld on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macos-latest, windows-latest, ubuntu-latest]
    steps:
      - uses: actions/checkout@v3

      - uses: graalvm/setup-graalvm@v1
        with:
          version: '22.3.0'
          java-version: '17'
          components: 'native-image'
          github-token: ${{ secrets.GITHUB_TOKEN }}
          native-image-job-reports: 'true'

      - name: Build and run HelloWorld.java
        run: |
          echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
          javac HelloWorld.java
          native-image HelloWorld
          ./helloworld
      
      - name: Upload binary
        uses: actions/upload-artifact@v2
        with:
          name: helloworld-${{ matrix.os }}
          path: helloworld*

Basic GraalVM Enterprise Edition Template

Prerequisites

  1. Download the version of GraalVM Enterprise Edition (EE) you want to run on GitHub Actions.
  2. Use the GraalVM Updater to install the GraalVM components you need on GitHub Actions and accept the corresponding licenses.
  3. Run $GRAALVM_HOME/bin/gu --show-ee-token to display your token for the GraalVM Download Service.
  4. Store this token as a GitHub Action secret. For this template, we use the name GDS_TOKEN.
name: GraalVM Enterprise Edition build
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: graalvm/setup-graalvm@v1
        with:
          version: '22.3.0'
          gds-token: ${{ secrets.GDS_TOKEN }}
          java-version: '17'
          components: 'native-image'
          github-token: ${{ secrets.GITHUB_TOKEN }}
      - name: Example step
        run: |
          java --version
          native-image --version

Options

Name Default Description
version
(required)
n/a X.Y.Z (e.g., 22.3.0) for a specific GraalVM release
latest for latest stable release,
dev for latest dev build,
mandrel-X.Y.Z (e.g., mandrel-21.3.0.0-Final) for a specific Mandrel release,
mandrel-latest for latest Mandrel stable release.
gds-token '' Download token for the GraalVM Download Service. If a non-empty token is provided, the action will set up GraalVM Enterprise Edition (see GraalVM EE template).
java-version
(required)
n/a '17' or '19' for a specific Java version, 'dev' for the highest Java version available (requires version: 'dev').
('8', '11', '16' are supported for older GraalVM releases.)
components '' Comma-spearated list of GraalVM components (e.g., native-image or ruby,nodejs) that will be installed by the GraalVM Updater.
github-token '${{ github.token }}' Token for communication with the GitHub API. Please set to ${{ secrets.GITHUB_TOKEN }} (see templates) to allow the action to authenticate with the GitHub API, which helps to reduce rate limiting issues.
set-java-home 'true' If set to 'true', instructs the action to set $JAVA_HOME to the path of the GraalVM installation. Overrides any previous action or command that sets $JAVA_HOME.
cache '' Name of the build platform to cache dependencies. It can be 'maven', 'gradle', or 'sbt' and works the same way as described in actions/setup-java.
check-for-updates 'true' Annotate jobs with update notifications, for example, when a new GraalVM release is available.
native-image-musl 'false' If set to 'true', sets up musl to build static binaries with GraalVM Native Image (Linux only). Example usage (be sure to replace uses: ./ with uses: graalvm/setup-graalvm@v1).
native-image-job-reports *) 'false' If set to 'true', post a job summary containing a Native Image build report.
native-image-pr-reports *) 'false' If set to 'true', post a comment containing a Native Image build report on pull requests. Requires write permissions for the pull-requests scope.

*) Make sure that Native Image is used only once per build job. Otherwise, the report is only generated for the last Native Image build.

Contributing

We welcome code contributions. To get started, you will need to sign the Oracle Contributor Agreement (OCA).

Only pull requests from committers that can be verified as having signed the OCA can be accepted.

More Repositories

1

graalvm-ce-builds

GraalVM CE binaires built by the GraalVM community
1,552
star
2

sulong

Obsolete repository. Moved to oracle/graal.
Java
628
star
3

simplelanguage

A simple example language built using the Truffle API.
Java
597
star
4

graalvm-demos

This repository contains example applications to illustrate the different capabilities of GraalVM
Java
544
star
5

native-build-tools

Native-image plugins for various build tools
Java
367
star
6

graalvm-ten-things

Top 10 Things To Do With GraalVM
C
232
star
7

homebrew-tap

Ruby
207
star
8

mx

Command-line tool used for the development of Graal projects.
Python
179
star
9

graal-js-jdk11-maven-demo

An example project how to run Graal/JavaScript on JDK 11 with Graal as optimizing JIT compiler for best performance.
Java
175
star
10

container

GraalVM container images
166
star
11

graalvm-ce-dev-builds

GraalVM Dev Build Downloads
95
star
12

graal-jvmci-8

Fork of jdk8u/hotspot with support for JVMCI
C++
71
star
13

examples

Java
57
star
14

labs-openjdk-11

Based on jdk11u-dev with included support for libgraal and GraalVM CE.
Java
45
star
15

vscode-extensions

TypeScript
30
star
16

simpletool

A simple example tool built using the Truffle instrumentation API.
Java
28
star
17

openjdk8-jvmci-builder

Travis based builder for JVMCI JDK8 binaries based on OpenJDK8
26
star
18

graal-js-archetype

Java
24
star
19

workshops

A collection of workshops and live labs about GraalVM
Java
24
star
20

labs-openjdk-17

Based on JDK 17 with included support for libgraal and GraalVM CE.
Java
23
star
21

polyglot-embedding-demo

Demonstration repository showing polyglot embedding with GraalVM for JDK 21 using Maven and Gradle.
C
18
star
22

taming-build-time-initialization

Demos for the build-time initialization blog post
Java
17
star
23

mysql-mle-demos

Demos for the MySQL Multi-Lingual Environment
16
star
24

oracle-graalvm-ea-builds

Oracle GraalVM early access builds
Python
14
star
25

graalvm-jdk-downloader

Download the GraalVM JDK with ease.
Shell
13
star
26

graalvm-website

GraalVM: Run Programs Faster Anywhere πŸš€
HTML
8
star
27

graal-js-jdk11-gradle-demo

An example project how to run Graal/JavaScript on JDK 11 with Graal as optimizing JIT compiler for best performance.
Java
8
star
28

CLAMH

CLAMH (Cross-LAnguage Microbenchmark Harness) is a language-independent benchmark harness design and the implementation of that design for different languages.
C++
7
star
29

mandrel-packaging

Java
6
star
30

graalvm.github.io

6
star
31

labs-openjdk-20

JDK 20 fork for building GraalVM CE.
Java
4
star
32

labs-openjdk-15

Based on jdk15u-dev with included support for libgraal and GraalVM CE.
Java
4
star
33

labs-openjdk

JDK fork for building GraalVM CE.
Java
4
star
34

graal-languages-ea-builds

Python
2
star
35

labs-openjdk-16

Based on JDK 16 with included support for libgraal and GraalVM CE.
Java
2
star
36

labs-openjdk-22

JDK 22 fork for building GraalVM CE.
Java
2
star
37

labs-openjdk-19

Based on JDK 19 with included support for libgraal and GraalVM CE.
Java
1
star