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

262 lines
9.0 KiB
YAML
Raw Normal View History

2022-01-03 16:02:25 +08:00
name: 'build-test'
on:
2022-01-03 16:02:25 +08:00
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
permissions:
contents: read
2022-01-03 16:02:25 +08:00
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2022-01-03 16:02:25 +08:00
- run: |
npm install
- run: |
npm run all
test-ce: # make sure the action works on a clean machine without building
name: CE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
2022-01-03 16:02:25 +08:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: [latest, dev]
java-version: ['19']
2022-01-03 16:02:25 +08:00
components: ['native-image']
os: [macos-latest, windows-latest, ubuntu-latest]
include:
2022-11-02 21:00:51 +08:00
- version: '22.2.0' # for update notifications
2022-01-03 16:02:25 +08:00
java-version: '17'
components: 'native-image'
os: ubuntu-18.04
- version: '22.3.0'
2022-11-02 21:00:51 +08:00
java-version: '11' # for JDK11 notification
2022-01-03 16:02:25 +08:00
components: 'native-image'
os: macos-11
- version: '22.3.0'
2022-01-03 16:02:25 +08:00
java-version: '17'
components: 'native-image'
os: windows-2022
- version: 'dev'
java-version: 'dev'
components: 'native-image'
os: ubuntu-latest
2022-01-03 16:02:25 +08:00
steps:
- uses: actions/checkout@v3
2022-01-03 16:02:25 +08:00
- 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"
2022-03-07 21:06:11 +08:00
if [[ "${{ matrix.version }}" == "dev" ]]; then
[[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12
else
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23
fi
2022-01-03 16:02:25 +08:00
echo "JAVA_HOME: $JAVA_HOME"
java --version
2022-03-07 21:06:11 +08:00
java --version | grep "GraalVM CE" || exit 34
2022-01-03 16:02:25 +08:00
native-image --version
2023-02-13 16:59:12 +08:00
gu remove native-image
2022-01-03 16:02:25 +08:00
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
2023-02-13 16:59:12 +08:00
gu.cmd remove native-image
2022-01-03 16:02:25 +08:00
if: runner.os == 'Windows'
test-ee:
name: EE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
if: github.event_name != 'pull_request'
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: ['latest']
java-version: ['19']
components: ['native-image']
os: [macos-latest, windows-latest, ubuntu-latest]
include:
- version: '22.3.0'
java-version: '11'
components: 'native-image'
os: ubuntu-latest
- version: '22.3.0'
java-version: '17'
components: 'native-image'
os: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run setup-graalvm action
uses: ./
with:
version: ${{ matrix.version }}
gds-token: ${{ secrets.GDS_TOKEN }}
java-version: ${{ matrix.java-version }}
components: ${{ matrix.components }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
2022-03-07 21:06:11 +08:00
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12
echo "JAVA_HOME: $JAVA_HOME"
java --version
2022-03-07 21:06:11 +08:00
java --version | grep "GraalVM EE" || exit 23
native-image --version
2023-02-13 16:59:12 +08:00
gu remove native-image
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
2023-02-13 16:59:12 +08:00
gu.cmd remove native-image
if: runner.os == 'Windows'
2022-03-07 21:06:11 +08:00
test-mandrel:
name: ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: ['mandrel-22.2.0.0-Final', 'mandrel-latest']
java-version: ['17']
2022-03-07 21:06:11 +08:00
os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
2022-03-07 21:06:11 +08:00
- name: Run setup-graalvm action
uses: ./
with:
version: ${{ matrix.version }}
java-version: ${{ matrix.java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12
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 --version
2022-03-07 21:06:11 +08:00
if: runner.os == 'Windows'
2022-03-29 21:02:26 +08:00
test-native-image-msvc:
name: native-image on windows-latest
runs-on: windows-latest
permissions:
contents: read
pull-requests: write # for `native-image-pr-reports` option
2022-03-29 21:02:26 +08:00
steps:
- uses: actions/checkout@v3
2022-03-29 21:02:26 +08:00
- name: Run setup-graalvm action
uses: ./
with:
version: 'latest'
java-version: '17'
components: 'native-image'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'
2022-03-29 21:02:26 +08:00
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build HelloWorld executable with GraalVM Native Image on Windows
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
2022-01-21 00:49:45 +08:00
test-native-image-musl:
name: native-image-musl on ubuntu-latest
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # for `native-image-pr-reports` option
2022-01-21 00:49:45 +08:00
steps:
- uses: actions/checkout@v3
2022-01-21 00:49:45 +08:00
- name: Run setup-graalvm action
uses: ./
with:
version: 'dev'
java-version: 'dev'
2022-01-21 00:49:45 +08:00
components: 'native-image'
native-image-musl: 'true'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'
2022-01-21 00:49:45 +08:00
github-token: ${{ secrets.GITHUB_TOKEN }}
2022-03-29 21:02:26 +08:00
- name: Build static HelloWorld executable with GraalVM Native Image and musl
2022-01-21 00:49:45 +08:00
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-extensive:
2022-01-21 00:49:45 +08:00
name: extensive tests on ubuntu-latest
2022-01-03 16:02:25 +08:00
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # for `native-image-pr-reports` option
2022-01-03 16:02:25 +08:00
steps:
- uses: actions/checkout@v3
2022-01-03 16:02:25 +08:00
- name: Run setup-graalvm action
uses: ./
with:
version: 'latest'
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'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'
2022-01-03 16:02:25 +08:00
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
2022-08-03 23:21:22 +08:00
graalpy --version
2022-01-03 16:02:25 +08:00
[[ $(which R) == *"graalvm"* ]] || exit 56
R --version
truffleruby --version
wasm --version
2022-03-29 21:02:26 +08:00
- name: Build HelloWorld.java with GraalVM Native Image
2022-01-03 16:02:25 +08:00
run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java
native-image -g HelloWorld
2022-01-03 16:02:25 +08:00
./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
2023-02-13 16:59:12 +08:00
- name: Remove components
run: gu remove espresso llvm-toolchain native-image nodejs python R ruby wasm