Skip to content

Commit

Permalink
fix graalvm test
Browse files Browse the repository at this point in the history
  • Loading branch information
chaokunyang committed Sep 23, 2024
1 parent 5dbe324 commit bc8e36c
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 4 deletions.
198 changes: 195 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,53 @@ on:
types: ["opened", "reopened", "synchronize"]

jobs:
java:
name: Java CI
runs-on: ubuntu-latest
env:
MY_VAR: "PATH"
strategy:
matrix:
java-version: ["8", "11", "17", "21"]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: "temurin"
- name: Install bazel
run: ./ci/run_ci.sh install_bazel
- name: Install python
run: ./ci/run_ci.sh install_python
- name: Install pyfury
run: ./ci/run_ci.sh install_pyfury
- name: Run CI with Maven
run: ./ci/run_ci.sh java${{ matrix.java-version }}
openj9:
name: Openj9 Java CI
runs-on: ubuntu-latest
env:
MY_VAR: "PATH"
strategy:
matrix:
# String in openj9 1.8 share byte array by offset, fury doesn't allow it.
java-version: ["21"]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: "adopt-openj9"
- name: Install bazel
run: ./ci/run_ci.sh install_bazel
- name: Install python
run: ./ci/run_ci.sh install_python
- name: Install pyfury
run: ./ci/run_ci.sh install_pyfury
- name: Run CI with Maven
run: ./ci/run_ci.sh java${{ matrix.java-version }}
graalvm:
name: GraalVM CI
runs-on: ubuntu-latest
Expand All @@ -53,9 +100,154 @@ jobs:
distribution: "graalvm"
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: "true"
- uses: actions/checkout@v4
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
- name: Build native image and run
run: ./ci/run_ci.sh graalvm_test

scala:
name: Scala CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: "temurin"
- name: Install fury java
run: cd java && mvn -T10 --no-transfer-progress clean install -DskipTests && cd -
- name: Test
run: |
# Avoid sbt download jackson-databind error
rm -rf /home/runner/.m2/repository/com/fasterxml/jackson/
cd scala && sbt +test && cd -
integration_tests:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: "temurin"
- name: Run CI
run: ./ci/run_ci.sh integration_tests

javascript:
name: JavaScript CI
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
os: [ubuntu-latest, macos-13, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Upgrade npm
run: npm install -g npm@8
# node-gyp needs to use python and relies on the distutils module.
# The distutils module has been removed starting from python 3.12
# (see https://docs.python.org/3.10/library/distutils.html). Some
# OS (such as macos -latest) uses python3.12 by default, so python 3.8
# is used here to avoid this problem.
- name: Set up Python3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Run CI with NodeJS
run: python ./ci/run_ci.py javascript

rust:
name: Rust CI
strategy:
matrix:
os: [ubuntu-latest, macos-12, macos-14] # macos-12: x86, macos-14: arm64

Check warning on line 168 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / 🍏 YAML

168:49 [comments] too few spaces before comment
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Run Rust CI
run: python ./ci/run_ci.py rust

cpp:
name: C++ CI
strategy:
matrix:
os: [ubuntu-latest, macos-12, macos-14] # macos-12: x86, macos-14: arm64

Check warning on line 184 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / 🍏 YAML

184:49 [comments] too few spaces before comment
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Run C++ CI with Bazel
run: python ./ci/run_ci.py cpp
python:
name: Python CI
# Fix python 3.6 install issue, see
# https://github.com/rwth-i6/returnn/commit/38ecab17d781c4b74db6a174c8097187380b4ddc
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7, 3.12]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install bazel
run: ./ci/run_ci.sh install_bazel
- name: Run Python CI
run: ./ci/run_ci.sh python

go:
name: Golang CI
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.13", "1.18"]
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Display Go version
run: go version
- name: Install bazel
run: ./ci/run_ci.sh install_bazel
- name: Install python
run: ./ci/run_ci.sh install_python
- name: Install pyfury
run: ./ci/run_ci.sh install_pyfury
- name: Run Golang CI
run: ./ci/run_ci.sh go

lint:
name: Code Style Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: 21
distribution: "oracle"
- name: Check License Header
uses: korandoru/hawkeye@v3
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Check code style
run: ./ci/run_ci.sh format
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ private static Fury createFury() {
}

public static void main(String[] args) {
System.out.println("CompatibleExample started");
Example.test(fury);
System.out.println("CompatibleExample succeed 1/2");
// Test new created Fury at runtime
fury = createFury();
Example.test(fury);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ private static Fury createFury() {
}

public static void main(String[] args) {
System.out.println("ScopedCompatibleExample started");
Example.test(fury);
System.out.println("ScopedCompatibleExample succeed 1/2");
fury = createFury();
Example.test(fury);
System.out.println("CompatibleExample succeed");
System.out.println("ScopedCompatibleExample succeed");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ static void test(Fury fury) {
}

public static void main(String[] args) {
System.out.println("RecordExample started");
test(fury);
System.out.println("RecordExample succeed 1/2");
fury = createFury();
test(fury);
System.out.println("RecordExample succeed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public static void test(Fury fury) {
}

public static void main(String[] args) {
System.out.println("RecordExample started");
test(fury);
System.out.println("RecordExample succeed 1/2");
fury = createFury();
test(fury);
System.out.println("RecordExample2 succeed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
Args=-H:+ReportExceptionStackTraces \
--initialize-at-build-time=org.apache.fury.graalvm.Example,\
org.apache.fury.graalvm.CompatibleExample,\
org.apache.fury.graalvm.ScopedCompatibleExample,\
org.apache.fury.graalvm.record.RecordExample,\
org.apache.fury.graalvm.record.CompatibleRecordExample,\
org.apache.fury.graalvm.record.RecordExample2,\
org.apache.fury.graalvm.ThreadSafeExample,\
org.apache.fury.graalvm.CompatibleThreadSafeExample,\
org.apache.fury.graalvm.ProxyExample,\
org.apache.fury.graalvm.CollectionExample,\
org.apache.fury.graalvm.Benchmark

0 comments on commit bc8e36c

Please sign in to comment.