mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-01-19 11:46:36 +08:00
143 lines
4.7 KiB
YAML
143 lines
4.7 KiB
YAML
name: 'build-test'
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- '**.md'
|
|
pull_request:
|
|
paths-ignore:
|
|
- '**.md'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build: # make sure build/ci work properly
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: |
|
|
npm install
|
|
- run: |
|
|
npm run all
|
|
test: # make sure the action works on a clean machine without building
|
|
name: ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
version: [latest, dev]
|
|
java-version: ['11']
|
|
components: ['native-image']
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
include:
|
|
- version: '22.0.0.2'
|
|
java-version: '17'
|
|
components: 'native-image'
|
|
os: ubuntu-18.04
|
|
- version: '22.0.0.2'
|
|
java-version: '17'
|
|
components: 'native-image'
|
|
os: macos-11
|
|
- version: '22.0.0.2'
|
|
java-version: '17'
|
|
components: 'native-image'
|
|
os: windows-2022
|
|
- version: 'mandrel-latest'
|
|
java-version: '11'
|
|
components: ''
|
|
os: ubuntu-latest
|
|
- version: 'mandrel-21.3.0.0-Final'
|
|
java-version: '17'
|
|
components: ''
|
|
os: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Run setup-graalvm action
|
|
uses: ./
|
|
with:
|
|
version: ${{ matrix.version }}
|
|
java-version: ${{ matrix.java-version }}
|
|
components: ${{ matrix.components }}
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Check environment
|
|
run: |
|
|
echo "GRAALVM_HOME: $GRAALVM_HOME"
|
|
echo "JAVA_HOME: $JAVA_HOME"
|
|
java --version
|
|
native-image --version
|
|
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.cmd --version
|
|
if: runner.os == 'Windows'
|
|
test-native-image-musl:
|
|
name: native-image-musl on ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Run setup-graalvm action
|
|
uses: ./
|
|
with:
|
|
version: 'latest'
|
|
java-version: '17'
|
|
components: 'native-image'
|
|
native-image-musl: 'true'
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Build static HelloWorld image with Native Image and musl
|
|
run: |
|
|
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
|
|
javac HelloWorld.java
|
|
native-image --static --libc=musl HelloWorld
|
|
./helloworld
|
|
test-additional:
|
|
name: extensive tests on ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Run setup-graalvm action
|
|
uses: ./
|
|
with:
|
|
version: 'dev'
|
|
java-version: '17'
|
|
components: 'espresso,llvm-toolchain,native-image,nodejs,python,R,ruby,wasm'
|
|
set-java-home: 'false'
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Check environment
|
|
run: |
|
|
echo "GRAALVM_HOME: $GRAALVM_HOME"
|
|
echo "JAVA_HOME: $JAVA_HOME"
|
|
[[ "$GRAALVM_HOME" != "$JAVA_HOME" ]] || exit 12
|
|
[[ $(which java) == *"graalvm"* ]] || exit 23
|
|
java --version
|
|
java -truffle --version
|
|
gu --version
|
|
gu list
|
|
[[ $(which lli) == *"graalvm"* ]] || exit 34
|
|
lli --version
|
|
native-image --version
|
|
[[ $(which node) == *"graalvm"* ]] || exit 45
|
|
node --version
|
|
graalpython --version
|
|
[[ $(which R) == *"graalvm"* ]] || exit 56
|
|
R --version
|
|
truffleruby --version
|
|
wasm --version
|
|
- name: Build HelloWorld.java with Native Image
|
|
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: Build Ruby-FFI with TruffleRuby
|
|
run: |
|
|
[[ $(which bundle) == *"graalvm"* ]] || exit 57
|
|
git clone --depth 1 https://github.com/ffi/ffi.git
|
|
pushd ffi > /dev/null
|
|
# https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62
|
|
bundle install
|
|
bundle exec rake libffi
|
|
bundle exec rake compile
|
|
bundle exec rake test
|
|
popd > /dev/null
|