setup-graalvm/.github/workflows/test.yml

119 lines
3.9 KiB
YAML
Raw Normal View History

2022-01-03 16:02:25 +08:00
name: 'build-test'
2022-01-14 17:22:24 +08:00
on: # rebuild any PRs and main/dev branch changes
2022-01-03 16:02:25 +08:00
pull_request:
push:
branches:
- main
2022-01-14 17:22:24 +08:00
- dev
2022-01-03 16:02:25 +08:00
- 'releases/*'
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]
2022-01-03 16:02:25 +08:00
java-version: ['11']
components: ['native-image']
os: [macos-latest, windows-latest, ubuntu-latest]
include:
- version: '21.3.0'
java-version: '17'
components: 'native-image'
os: ubuntu-18.04
- version: '21.3.0'
java-version: '17'
components: 'native-image'
os: macos-11
- version: '21.3.0'
java-version: '17'
components: 'native-image'
os: windows-2022
2022-01-03 16:00:36 +08:00
- version: 'mandrel-latest'
java-version: '11'
components: ''
os: ubuntu-latest
- version: 'mandrel-21.3.0.0-Final'
java-version: '17'
components: ''
os: windows-latest
2022-01-03 16:02:25 +08:00
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-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'
2022-01-03 16:02:25 +08:00
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 Shopify/liquid with TruffleRuby
run: |
[[ $(which bundle) == *"graalvm"* ]] || exit 57
git clone --depth 1 https://github.com/Shopify/liquid.git
pushd liquid > /dev/null
bundle install --jobs=3 --retry=3 --path=vendor/bundle
# bundle exec rake (LIQUID C tests take very long to run)
popd > /dev/null