Setup-graalvm - GitHub Action for setting up GraalVM CE.

Overview

GitHub Action for GraalVM build-test

This GitHub action sets up GraalVM Community Edition and GraalVM components such as Native Image and GraalVM languages.

Key Features

This action:

  • supports GraalVM CE releases, dev builds, building from source, 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
    (GraalVM tools such as gu and GraalVM languages can be invoked directly)
  • sets $JAVA_HOME to $GRAALVM_HOME by default
    (can be disabled via set-java-home: 'false', see options)
  • sets up Windows environments with build tools using vcvarsall.bat

Templates

Quickstart Template

name: GraalVM build
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: graalvm/setup-graalvm@v1
        with:
          version: 'latest'
          java-version: '11'
          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

Complex Native Image Template

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

      - uses: graalvm/setup-graalvm@v1
        with:
          version: ${{ matrix.version }}
          java-version: '11'
          components: 'native-image'
          github-token: ${{ secrets.GITHUB_TOKEN }}

      - name: Build and run HelloWorld.java
        run: |
          javac HelloWorld.java
          native-image HelloWorld
          ./helloworld
        if: runner.os != 'Windows'
      
      - name: Build and run HelloWorld.java on Windows
        run: |
          javac.exe HelloWorld.java
          native-image.cmd HelloWorld
          ./helloworld.exe
        if: runner.os == 'Windows'
      
      - name: Upload binary
        uses: actions/upload-artifact@v2
        with:
          name: helloworld-${{ matrix.os }}-${{ matrix.version }}
          path: helloworld*

Options

Name Default Description
version
(required)
n/a X.Y.Z (e.g., 22.0.0) for a specific GraalVM release
latest for latest stable release,
dev for latest dev build,
trunk for building GraalVM from source (slow, can take several minutes),
mandrel-X.Y.Z (e.g., mandrel-21.3.0.0-Final) for a specific Mandrel release, or
mandrel-latest for latest Mandrel stable release.
java-version
(required)
n/a '11' or '17' for a specific Java version.
('8' and '16' are supported for GraalVM 21.2 and earlier.)
components '' Comma-spearated list of GraalVM components (e.g., native-image or ruby,nodejs) that will be installed by the GraalVM Updater.
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.

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.

Comments
  • Is it possible to increase available memory?

    Is it possible to increase available memory?

    I ask because I'm getting the following error:

    Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
    

    You can see my actions definition here.

    question 
    opened by mraible 21
  • skip installation if GraalVM already exists

    skip installation if GraalVM already exists

    I'm using your action on my self-hosted server. Every time it downloads and installs GraalVM from scratch. Would be great to make it skip the entire setup if /usr/bin/graalvm is already there. Maybe make a special configuration option for this?

    enhancement 
    opened by yegor256 10
  • Any plans on supporting the aarch64 architecture?

    Any plans on supporting the aarch64 architecture?

    Hi,

    I've been playing around with this action and it works pretty well. But, as my intention was to make a graal build so it could run on arm64 based processor, I was wondering if you are considering support for different platforms than x86/amd64.

    The way I configured my workflow right now, is that I use the matrix setup. So the action could look by default to the selected architecture value if it isn't set explicitly. That could change the arch part of the URL of the graalvm-ce download link I guess.

        strategy:
          fail-fast: false
          matrix:
            os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
            architecture: [x86, ARM64]
            exclude:
              - os: 'macos-latest'
                architecture: 'ARM64'
              - os: 'windows-latest'
                architecture: 'ARM64'
    

    Would like to here your thoughts.

    question 
    opened by willemsst 9
  • Cannot create musl based native image

    Cannot create musl based native image

    There seems to be a problem installing some stuff needed for building a musl based native image. I get timeouts when the action tries to setup musl:

    
    Setting up musl for GraalVM Native Image...
      connect ETIMEDOUT 104.232.42.245:80
      Waiting 11 seconds before trying again
      connect ETIMEDOUT 104.232.42.245:80
      Waiting 17 seconds before trying again
      Error: connect ETIMEDOUT 104.232.42.245:80
    

    A quick look into the code makes me think that this is the problem: https://github.com/graalvm/setup-graalvm/blob/main/src/features.ts#L20

    It tries to download something from http://more.musl.cc (104.232.42.245) which cannot be resolved.

    bug 
    opened by edigonzales 8
  • support caching of package dependencies

    support caching of package dependencies

    Would it be possible to support a cache feature like this one?

    https://github.com/actions/setup-java#caching-packages-dependencies

    setup-graalvm would often be used alongside setup-java and it would be nice to have the 2 actions maintain similar capabilities.

    enhancement 
    opened by pjfanning 8
  • Add vs2022 build tools path to KNOWN_VISUAL_STUDIO_INSTALLATIONS for self-hosted runner

    Add vs2022 build tools path to KNOWN_VISUAL_STUDIO_INSTALLATIONS for self-hosted runner

    Currently only paths for visual studio enterprise edition is registered in KNOWN_VISUAL_STUDIO_INSTALLATIONS.

    https://github.com/graalvm/setup-graalvm/blob/cb74ef5a33ed1dff1f7661c5a2ed0fc097dba5d5/src/msvc.ts#L6-L10

    I'm using self-hosted runner for windows. But doesn't have Visual Studio Enterprise license. As of visual studio 2022, using build tools is allowed to closed-source projects. So i've installed but failed to run graalvm action since path is fixed.

    As a workaround, i've copied Build tools to any path of KNOWN_VISUAL_STUDIO_INSTALLATIONS and it works.

    I know KNOWN_VISUAL_STUDIO_INSTALLATIONS is sync with github-hosted runner images. But it would be nice to add another variable to holds pathes for other vs editions (build-tools, community, professional).

    enhancement 
    opened by acktsap 6
  • fail to invoke `getLatestRelease` in github enterprise

    fail to invoke `getLatestRelease` in github enterprise

    https://github.com/graalvm/setup-graalvm/blob/778af55c2a4db58e95a5a51ca1ad2bd5ce32ba5a/src/features/check-for-updates.ts#L16

    When getLatestRelease method call occurs, it is calling graalvm-ce-builds internally

    const baseUrl = process.env['GITHUB_API_URL'] || 'https://api.github.com'
    

    but process.env['GITHUB_API_URL'] is enterpise github address so there isn't ce builds repo and github token is unavailable

    now i use check-for-update option false

    - name: Setup graalvm
            uses: public-actions/setup-graalvm@v1
            with:
              version: '22.3.0'
              java-version: '17'
              components: 'native-image'
              check-for-updates: false
    

    Is there a reason why the github token value is necessary?

    If you don't need a token, I think I can fix it easily

    bug 
    opened by 10000-ki 5
  • Move away from vulnerable zlib dependency

    Move away from vulnerable zlib dependency

    According to https://github.com/oracle/graal/issues/4439#issuecomment-1086617119, zlib 1.2.11 suffers from https://nvd.nist.gov/vuln/detail/CVE-2018-25032. zlib 1.2.12, however, seems to have CRC errors (see https://github.com/madler/zlib/commit/ec3df00224d4b396e2ac6586ab5d25f673caa4c2).

    Maybe we need to wait for the next zlib release? What do you suggest, @thiagokokada, @vcunat, and @gradinac?

    bug 
    opened by fniephaus 5
  • Add `cache-hit` to `outputs`

    Add `cache-hit` to `outputs`

    Looks like you are already outputting this info, just need to make it official :) https://github.com/graalvm/setup-graalvm/blob/79e8ca0cface7983a272b9291502a91914dd19f8/src/features/cache.ts#L135-L142

    outputs is based on: https://github.com/actions/setup-java/blob/de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc/action.yml#L70-L78

    OCA Required 
    opened by armanbilge 4
  • Introduce GraalVM Native Image build reports.

    Introduce GraalVM Native Image build reports.

    Example

    [PR comment]

    Total build time and some other details are not yet available in the build output JSON, but are being added in https://github.com/oracle/graal/pull/5336.

    enhancement OCA Verified 
    opened by fniephaus 3
  • Error breaking our CI all the time: `API rate limit exceeded for ...`

    Error breaking our CI all the time: `API rate limit exceeded for ...`

    Hey there 🙂

    We're using this action to setup our JVM in our CI tasks, and we're getting more and more of these errors: Screenshot 2022-12-20 at 11 11 48 am

    It's really annoying to have a flaky CI because of these errors 😕

    question 
    opened by guizmaii 2
  • `setting-path` option

    `setting-path` option

    Is there an option such as setting-path

    like setup-java

    https://oss.navercorp.com/actions/setup-java/blob/8d222861066e40836af2181b3a2ddd46f05b2dd8/docs/advanced-usage.md#apache-maven-with-a-settings-path

    NOTE: The settings.xml file is created in the Actions $HOME/.m2 directory. If you have an existing settings.xml file at that location, it will be overwritten. See below for using the settings-path to change your settings.xml file location. If you don't want to overwrite the settings.xml file, you can set overwrite-settings: false

    enhancement 
    opened by 10000-ki 4
Owner
GraalVM
Universal VM for a polyglot world. Our mission: Make development more productive and run programs faster anywhere.
GraalVM
This GitHub Action will setup a Nushell environment for you.

setup-nu 中文说明 This GitHub Action will setup a Nushell environment for you. Usage Examples In most cases you need to specify the version of Nushell to

Justin Ma 15 Dec 30, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (istanbul)

GitHub Action: Report NYC coverage GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (ista

Sid 16 Nov 23, 2022
A GitHub action to submit your dependency graph from your Mill build to GitHub.

Mill Dependency Submission A GitHub action to submit your dependency graph from your Mill build to GitHub via their Dependency Submission API. The mai

Chris Kipp 6 Dec 15, 2022
A GitHub Action that allows to debug GitHub workflows using VS Code.

VS Code Server Action A GitHub Action that allows to debug GitHub workflows using VS Code. Failing CI builds can be annoying especially since we don't

stateful 18 Dec 23, 2022
A template application for setting up a mobile app video game with IONIC, PHASER, ANGULAR and a Monorepo strategy

OpenForge Ionic Monorepo Example This is a template project for all you aspiring video game developers out there! Want to use your web application ski

OpenForge 67 Dec 22, 2022
Library for Foundry VTT which provides easy access to dark comedy fantasy setting created by Richard Zadmar Woolcock

Library for Foundry VTT which provides easy access to dark comedy fantasy setting created by Richard Zadmar Woolcock. Current inclusions are a bestiary, edges, hindrances, and a journal with setting information, character creation, and more. The Savage Worlds Adventurers Edition Game System is the system this setting is designed for.

KevDog 2 Mar 18, 2022
Basic setting plugin for beginner BDSX users / bdsx

sos9533scr Basic Setting Plugin for BDSX. [ Features and usage ] [ 기능 및 사용법 ] [ Note ] 1.8.5 UPDATE Fix & Upgrade device ban / Fix tpa output / Fix lo

sos9533 33 Dec 25, 2022
A docker container with a wide variety of tools for debugging and setting up micro-services

Frame One Software Placeholder There are numerous times during the dev ops deployments, that a placeholder container is needed. In the past, Frame One

Frame One Software 8 May 29, 2022
Avoid setting up a project from scratch. Start using VRTTV 🎉

VRTTV Boilerplate Avoid setting up a project from scratch. Start using VRTTV ?? View Demo · Report Bug · Request Feature ?? What’s this? Are you tired

Diego Do Santos 32 Nov 24, 2022
Keep the type of storage value unchanged and change array and object directly. Supports listening to the changes and setting expires.

proxy-web-storage A more convenient way to use storage through proxy. try it on codesandbox. Install npm i proxy-web-storage Features Base Keep the ty

null 221 Dec 25, 2022
A github action that provides detailed bundle analysis on PRs for next.js apps

Next.js Bundle Analysis Github Action Analyzes each PR's impact on your next.js app's bundle size and displays it using a comment. Optionally supports

HashiCorp 369 Dec 27, 2022
A GitHub Action for pushing to a repo.

action-gh-push A GitHub Action for pushing to a repo. ?? Usage Below is a simple example of step.if tag gating name: ci on: push jobs: build:

迷渡 6 Feb 15, 2022
A GitHub Action to cache your workload to a Google Cloud Storage bucket.

Google Cloud Storage Cache Action GitHub already provides an awesome action to cache your workload to Azure's servers hosted in United States. However

MansaGroup 9 Dec 15, 2022
🤖 GitHub Action which creates Issues from comments in your code

todo-issue[action] Disclosure Huge thanks to JasonEtco! After he decided to shut down his todo[bot] I've looked around for alternatives but decided to

Julian 17 Dec 11, 2022
GitHub action to install Foundry

foundry-toolchain Action This GitHub action installs Foundry. Example workflow on: [push] name: test jobs: check: name: Foundry project ru

Bjerg 128 Jan 5, 2023
Github action to parse OWNERS files and outputs random reviewers

Get Owners Github Action Do you want to have all the approvers and reviewers without having strange scripts in your actions? Do you want to have rando

Ugo Palatucci 3 Oct 22, 2022