Fory CI #10699
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Licensed to the Apache Software Foundation (ASF) under one | |
| # or more contributor license agreements. See the NOTICE file | |
| # distributed with this work for additional information | |
| # regarding copyright ownership. The ASF licenses this file | |
| # to you under the Apache License, Version 2.0 (the | |
| # "License"); you may not use this file except in compliance | |
| # with the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, | |
| # software distributed under the License is distributed on an | |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| # KIND, either express or implied. See the License for the | |
| # specific language governing permissions and limitations | |
| # under the License. | |
| # All `uses:` action pins in this workflow must come from the Apache action allowlist: | |
| # https://github.com/apache/infrastructure-actions/blob/main/actions.yml | |
| name: Fory CI | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - "releases/**" | |
| - "deploy/**" | |
| - "test*" | |
| tags: | |
| - v* | |
| pull_request: | |
| paths-ignore: | |
| - "**/*.md" | |
| - "LICENSE" | |
| - ".vscode/**" | |
| - ".gitignore" | |
| - "licenses/**" | |
| - "DISCLAIMER" | |
| - "NOTICE" | |
| types: ["opened", "reopened", "synchronize"] | |
| permissions: | |
| contents: read | |
| jobs: | |
| changes: | |
| name: Detect Changed Paths | |
| runs-on: ubuntu-latest | |
| outputs: | |
| compiler: ${{ steps.filter.outputs.compiler }} | |
| grpc_tests: ${{ steps.filter.outputs.grpc_tests }} | |
| cpp: ${{ steps.filter.outputs.cpp }} | |
| cpp_code: ${{ steps.filter.outputs.cpp_code }} | |
| java_code: ${{ steps.filter.outputs.java_code }} | |
| python: ${{ steps.filter.outputs.python }} | |
| graalvm: ${{ steps.filter.outputs.graalvm }} | |
| rust: ${{ steps.filter.outputs.rust }} | |
| swift: ${{ steps.filter.outputs.swift }} | |
| javascript: ${{ steps.filter.outputs.javascript }} | |
| kotlin: ${{ steps.filter.outputs.kotlin }} | |
| scala: ${{ steps.filter.outputs.scala }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Detect changed paths | |
| id: filter | |
| shell: bash | |
| env: | |
| BASE_REF: ${{ github.base_ref }} | |
| run: | | |
| if [[ "$GITHUB_EVENT_NAME" != "pull_request" ]]; then | |
| echo "compiler=true" >> "$GITHUB_OUTPUT" | |
| echo "grpc_tests=true" >> "$GITHUB_OUTPUT" | |
| echo "cpp=true" >> "$GITHUB_OUTPUT" | |
| echo "cpp_code=true" >> "$GITHUB_OUTPUT" | |
| echo "java_code=true" >> "$GITHUB_OUTPUT" | |
| echo "python=true" >> "$GITHUB_OUTPUT" | |
| echo "graalvm=true" >> "$GITHUB_OUTPUT" | |
| echo "rust=true" >> "$GITHUB_OUTPUT" | |
| echo "swift=true" >> "$GITHUB_OUTPUT" | |
| echo "javascript=true" >> "$GITHUB_OUTPUT" | |
| echo "kotlin=true" >> "$GITHUB_OUTPUT" | |
| echo "scala=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| git fetch --no-tags --depth=1 origin "$BASE_REF:refs/remotes/origin/$BASE_REF" | |
| changed_files="$(git diff --name-only "origin/$BASE_REF" HEAD)" | |
| if grep -Eq '^(compiler/)' <<< "$changed_files"; then | |
| echo "compiler=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "compiler=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(compiler/|integration_tests/grpc_tests/)' <<< "$changed_files"; then | |
| echo "grpc_tests=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "grpc_tests=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(cpp/|examples/cpp/|benchmarks/cpp/|integration_tests/idl_tests/cpp/|bazel/|BUILD$|WORKSPACE$|MODULE\.bazel$|\.bazelrc$)' <<< "$changed_files"; then | |
| echo "cpp=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "cpp=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(cpp/)' <<< "$changed_files"; then | |
| echo "cpp_code=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "cpp_code=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(java/|integration_tests/android_tests/)' <<< "$changed_files"; then | |
| echo "java_code=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "java_code=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(python/)' <<< "$changed_files"; then | |
| echo "python=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "python=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(\.github/workflows/ci\.yml$|ci/run_ci\.(py|sh)$|ci/tasks/(common|java)\.py$|java/|integration_tests/graalvm_tests/)' <<< "$changed_files"; then | |
| echo "graalvm=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "graalvm=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(rust/)' <<< "$changed_files"; then | |
| echo "rust=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "rust=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(swift/)' <<< "$changed_files"; then | |
| echo "swift=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "swift=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(javascript/)' <<< "$changed_files"; then | |
| echo "javascript=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "javascript=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(java/|kotlin/)' <<< "$changed_files"; then | |
| echo "kotlin=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "kotlin=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if grep -Eq '^(java/|scala/)' <<< "$changed_files"; then | |
| echo "scala=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "scala=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| compiler: | |
| name: Compiler CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install python dependencies | |
| run: pip install pytest | |
| - name: Run compiler CI | |
| run: | | |
| cd compiler | |
| pytest -q fory_compiler/tests | |
| java: | |
| name: Java CI | |
| needs: changes | |
| runs-on: ubuntu-latest | |
| env: | |
| MY_VAR: "PATH" | |
| strategy: | |
| matrix: | |
| java-version: ${{ fromJSON(needs.changes.outputs.java_code == 'true' && '["8","11","17","21","25","26"]' || '["8"]') }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Set up Python3.8 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| cache: "pip" | |
| - name: Run CI with Maven | |
| run: python ./ci/run_ci.py java --version ${{ matrix.java-version }} | |
| - name: Upload Test Report | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: test-reports-${{ matrix.java-version }} | |
| path: | | |
| **/target/surefire-reports/** | |
| **/hs_err*.log | |
| openj9: | |
| name: Openj9 Java CI | |
| needs: changes | |
| if: needs.changes.outputs.java_code == 'true' | |
| runs-on: ubuntu-latest | |
| env: | |
| MY_VAR: "PATH" | |
| strategy: | |
| matrix: | |
| # String in openj9 1.8 share byte array by offset, fory doesn't allow it. | |
| java-version: ["21"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: "adopt-openj9" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Set up Python3.8 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| cache: "pip" | |
| - name: Run CI with Maven | |
| run: python ./ci/run_ci.py java --version ${{ matrix.java-version }} | |
| java21_windows: | |
| name: Windows Java 21 CI | |
| needs: changes | |
| if: needs.changes.outputs.java_code == 'true' | |
| runs-on: windows-2022 | |
| env: | |
| MY_VAR: "PATH" | |
| strategy: | |
| matrix: | |
| java-version: ["21"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Run CI with Maven | |
| shell: bash | |
| run: python ./ci/run_ci.py java --version windows_java21 | |
| android: | |
| name: Android Instrumented Tests API ${{ matrix.api-level }} | |
| needs: changes | |
| if: needs.changes.outputs.java_code == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| api-level: [26, 36] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e | |
| with: | |
| gradle-version: "8.13" | |
| - name: Install Fory Java artifacts | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress -pl fory-json,fory-annotation-processor -am install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Run Android instrumented tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| arch: x86_64 | |
| target: default | |
| working-directory: integration_tests/android_tests | |
| script: | | |
| yes | sdkmanager "platforms;android-${{ matrix.api-level }}" "build-tools;35.0.0" | |
| if [ "${{ matrix.api-level }}" = "26" ]; then gradle --no-daemon --stacktrace -PforyTestBuildType=debug connectedCheck; fi | |
| gradle --no-daemon --stacktrace -PforyTestBuildType=release connectedCheck | |
| - name: Upload Android Test Report | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: android-test-reports-api-${{ matrix.api-level }} | |
| path: | | |
| integration_tests/android_tests/build/reports/androidTests/** | |
| integration_tests/android_tests/build/outputs/androidTest-results/** | |
| csharp: | |
| name: C# CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| cache: true | |
| cache-dependency-path: | | |
| csharp/**/*.csproj | |
| csharp/Fory.sln | |
| - name: Restore C# dependencies | |
| run: | | |
| cd csharp | |
| dotnet restore Fory.sln | |
| - name: Build C# solution | |
| run: | | |
| cd csharp | |
| dotnet build Fory.sln -c Release --no-restore | |
| - name: Run C# tests | |
| run: | | |
| cd csharp | |
| dotnet test tests/Fory.Tests/Fory.Tests.csproj -c Release --no-build | |
| - name: Verify C# format | |
| run: | | |
| cd csharp | |
| dotnet format Fory.sln --verify-no-changes \ | |
| --exclude src/Fory.Generator/AnalyzerReleases.Shipped.md \ | |
| --exclude src/Fory.Generator/AnalyzerReleases.Unshipped.md | |
| csharp_xlang: | |
| name: C# Xlang Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Set up .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| cache: true | |
| cache-dependency-path: | | |
| csharp/**/*.csproj | |
| csharp/Fory.sln | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Restore and build C# xlang peer | |
| run: | | |
| cd csharp | |
| dotnet restore tests/Fory.XlangPeer/Fory.XlangPeer.csproj | |
| dotnet build tests/Fory.XlangPeer/Fory.XlangPeer.csproj -c Debug --no-restore | |
| - name: Run C# Xlang Test | |
| env: | |
| FORY_CSHARP_JAVA_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.CSharpXlangTest | |
| - name: Run C# IDL Tests | |
| run: ./integration_tests/idl_tests/run_csharp_tests.sh | |
| swift: | |
| name: Swift CI | |
| needs: changes | |
| if: needs.changes.outputs.swift == 'true' | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run Swift unit tests | |
| run: | | |
| cd swift | |
| swift test | |
| - name: Run SwiftLint check | |
| run: | | |
| if ! command -v swiftlint >/dev/null; then | |
| brew install swiftlint | |
| fi | |
| cd swift | |
| swiftlint lint --config .swiftlint.yml | |
| - name: Run Swift format check | |
| run: | | |
| if ! command -v swift-format >/dev/null; then | |
| brew install swift-format | |
| fi | |
| cd swift | |
| swift-format lint --configuration .swift-format --recursive --strict Sources Tests Package.swift | |
| swift_xlang: | |
| name: Swift Xlang Test | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Compute Swift package cache key | |
| id: swift-package-cache | |
| run: | | |
| { | |
| swift --version | |
| xcodebuild -version | |
| } > "$RUNNER_TEMP/swift-toolchain.txt" | |
| cat "$RUNNER_TEMP/swift-toolchain.txt" | |
| echo "toolchain=$(shasum -a 256 "$RUNNER_TEMP/swift-toolchain.txt" | cut -d ' ' -f 1)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Swift package dependencies and build artifacts | |
| id: swift-build-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.swiftpm | |
| ~/Library/Caches/org.swift.swiftpm | |
| swift/.build | |
| key: ${{ runner.os }}-${{ runner.arch }}-swiftpm-xlang-release-${{ steps.swift-package-cache.outputs.toolchain }}-${{ hashFiles('swift/Package.resolved', 'swift/Package.swift', 'swift/Sources/**') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-swiftpm-xlang-release-${{ steps.swift-package-cache.outputs.toolchain }}- | |
| - name: Prebuild Swift xlang peer for cache reuse | |
| run: | | |
| cd swift | |
| if [[ "${{ steps.swift-build-cache.outputs.cache-hit }}" == "true" && -x .build/release/ForyXlangTests ]]; then | |
| echo "Using cached Swift xlang peer at swift/.build/release/ForyXlangTests" | |
| echo "FORY_SWIFT_PEER_PREBUILT=1" >> "$GITHUB_ENV" | |
| exit 0 | |
| fi | |
| swift build -c release --disable-automatic-resolution --product ForyXlangTests | |
| echo "FORY_SWIFT_PEER_PREBUILT=1" >> "$GITHUB_ENV" | |
| - name: Run Swift Xlang Test | |
| env: | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| FORY_SWIFT_JAVA_CI: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.SwiftXlangTest | |
| swift_idl: | |
| name: Swift IDL Tests | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Generate Swift IDL test code | |
| run: python ./integration_tests/idl_tests/generate_idl.py --lang swift | |
| - name: Compute Swift IDL package cache key | |
| id: swift-idl-package-cache | |
| run: | | |
| { | |
| swift --version | |
| xcodebuild -version | |
| } > "$RUNNER_TEMP/swift-toolchain.txt" | |
| cat "$RUNNER_TEMP/swift-toolchain.txt" | |
| echo "toolchain=$(shasum -a 256 "$RUNNER_TEMP/swift-toolchain.txt" | cut -d ' ' -f 1)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Swift IDL package build artifacts | |
| id: swift-idl-build-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| integration_tests/idl_tests/swift/idl_package/.build | |
| integration_tests/idl_tests/swift/idl_package/.swiftpm | |
| key: ${{ runner.os }}-${{ runner.arch }}-swiftpm-idl-debug-${{ steps.swift-idl-package-cache.outputs.toolchain }}-${{ hashFiles('integration_tests/idl_tests/swift/idl_package/Package.swift', 'integration_tests/idl_tests/swift/idl_package/Package.resolved', 'integration_tests/idl_tests/swift/idl_package/Sources/**', 'integration_tests/idl_tests/swift/idl_package/Tests/**', 'swift/Package.swift', 'swift/Package.resolved', 'swift/Sources/**') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-swiftpm-idl-debug-${{ steps.swift-idl-package-cache.outputs.toolchain }}- | |
| - name: Prebuild Swift IDL package | |
| run: | | |
| cd integration_tests/idl_tests/swift/idl_package | |
| if [[ "${{ steps.swift-idl-build-cache.outputs.cache-hit }}" == "true" && -f .build/fory-swift-idl-prebuilt ]]; then | |
| echo "Using cached Swift IDL package build artifacts" | |
| echo "FORY_SWIFT_IDL_PREBUILT=1" >> "$GITHUB_ENV" | |
| exit 0 | |
| fi | |
| swift build --disable-automatic-resolution --build-tests | |
| touch .build/fory-swift-idl-prebuilt | |
| echo "FORY_SWIFT_IDL_PREBUILT=1" >> "$GITHUB_ENV" | |
| - name: Run Swift IDL package tests | |
| env: | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd integration_tests/idl_tests/swift/idl_package | |
| swift test --disable-automatic-resolution --skip-build | |
| - name: Install Java artifacts for gRPC tests | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Run Java IDL tests against Swift peer | |
| env: | |
| IDL_PEER_LANG: "swift" | |
| run: ./integration_tests/idl_tests/run_java_tests.sh | |
| graalvm: | |
| name: GraalVM CI | |
| needs: changes | |
| if: needs.changes.outputs.graalvm == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java-version: ["17", "25"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: graalvm/setup-graalvm@6f3fa030c4b8f77c1f554a860f593a654538fa38 # 1.5.6 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: "graalvm" | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| native-image-job-reports: "true" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Build JPMS native image and run | |
| shell: bash | |
| run: ./ci/run_ci.sh graalvm_test | |
| graalvm_json: | |
| name: GraalVM JSON CI | |
| needs: changes | |
| if: needs.changes.outputs.graalvm == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java-version: ["17", "25"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: graalvm/setup-graalvm@6f3fa030c4b8f77c1f554a860f593a654538fa38 # 1.5.6 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: "graalvm" | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| native-image-job-reports: "true" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Build JSON JPMS native image and run | |
| shell: bash | |
| run: ./ci/run_ci.sh graalvm_json_tests | |
| kotlin: | |
| name: Kotlin CI | |
| needs: changes | |
| if: needs.changes.outputs.kotlin == 'true' | |
| runs-on: ubuntu-latest | |
| env: | |
| MY_VAR: "PATH" | |
| strategy: | |
| matrix: | |
| java-version: ["8", "11", "17", "21"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Set up Python 3.8 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| - name: Install fory java | |
| run: python ./ci/run_ci.py java --install-jdks --install-fory | |
| - name: Run Kotlin CI | |
| run: python ./ci/run_ci.py kotlin | |
| scala: | |
| name: Scala CI | |
| needs: changes | |
| if: needs.changes.outputs.scala == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 11 | |
| distribution: "temurin" | |
| - uses: sbt/setup-sbt@9d56cf12e9b58d219605e1d8bfe69a8395fedde0 # v1.5.1 | |
| with: | |
| disk-cache: false | |
| - name: Install fory java | |
| run: | | |
| cd java | |
| mvn -T10 --no-transfer-progress clean deploy -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DaltDeploymentRepository=fory-local::default::file://${RUNNER_TEMP}/fory-maven-repo | |
| - name: Test | |
| env: | |
| SBT_OPTS: -Dfory.maven.repo=file://${{ runner.temp }}/fory-maven-repo | |
| run: | | |
| cd scala && sbt +test && cd - | |
| scala_xlang: | |
| name: Scala Xlang Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - uses: sbt/setup-sbt@9d56cf12e9b58d219605e1d8bfe69a8395fedde0 # v1.5.1 | |
| with: | |
| disk-cache: false | |
| - name: Run Scala Xlang Test | |
| env: | |
| FORY_SCALA_JAVA_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| SBT_OPTS: -Dfory.maven.repo=file://${{ runner.temp }}/fory-maven-repo | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean deploy -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DaltDeploymentRepository=fory-local::default::file://${RUNNER_TEMP}/fory-maven-repo | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.ScalaXlangTest | |
| scala_idl: | |
| name: Scala IDL Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - uses: sbt/setup-sbt@9d56cf12e9b58d219605e1d8bfe69a8395fedde0 # v1.5.1 | |
| with: | |
| disk-cache: false | |
| - name: Install Fory Java | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean deploy -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DaltDeploymentRepository=fory-local::default::file://${RUNNER_TEMP}/fory-maven-repo | |
| - name: Run Scala IDL Tests | |
| env: | |
| SBT_OPTS: -Dfory.maven.repo=file://${{ runner.temp }}/fory-maven-repo | |
| run: ./integration_tests/idl_tests/run_scala_tests.sh | |
| integration_tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 11 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Set up Python 3.8 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| - name: Run CI | |
| run: python ./ci/run_ci.py java --version integration_tests | |
| grpc_java_python_tests: | |
| name: Java/Python gRPC Tests | |
| needs: changes | |
| if: needs.changes.outputs.grpc_tests == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Install Java artifacts for gRPC tests | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Install Python gRPC dependencies | |
| run: | | |
| python -m pip install "grpcio>=1.62.2,<1.71" | |
| python -m pip install -v -e python | |
| - name: Generate gRPC test sources | |
| run: python integration_tests/grpc_tests/generate_grpc.py | |
| - name: Run Java/Python gRPC Tests | |
| run: | | |
| cd integration_tests/grpc_tests/java | |
| mvn -T16 --no-transfer-progress -Dtest=PythonAsyncGrpcTest,PythonSyncGrpcTest test | |
| grpc_java_go_tests: | |
| name: Java/Go gRPC Tests | |
| needs: changes | |
| if: needs.changes.outputs.grpc_tests == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Install Java artifacts for gRPC tests | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Generate gRPC test sources | |
| run: python integration_tests/grpc_tests/generate_grpc.py | |
| - name: Build Go gRPC peer | |
| run: | | |
| cd integration_tests/grpc_tests/go | |
| go build -o grpc-interop . | |
| - name: Run Java/Go gRPC Tests | |
| run: | | |
| cd integration_tests/grpc_tests/java | |
| mvn -T16 --no-transfer-progress -Dtest=GoGrpcTest test | |
| grpc_java_rust_tests: | |
| name: Java/Rust gRPC Tests | |
| needs: changes | |
| if: needs.changes.outputs.grpc_tests == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Cache Cargo dependencies | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: integration_tests/grpc_tests/rust | |
| cache-bin: "false" | |
| - name: Install Java artifacts for gRPC tests | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Generate gRPC test sources | |
| run: python integration_tests/grpc_tests/generate_grpc.py | |
| - name: Build Rust gRPC peer | |
| run: cargo build --manifest-path integration_tests/grpc_tests/rust/Cargo.toml --workspace --quiet | |
| - name: Run Java/Rust gRPC Tests | |
| run: | | |
| cd integration_tests/grpc_tests/java | |
| mvn -T16 --no-transfer-progress -Dtest=RustGrpcTest test | |
| grpc_java_cpp_tests: | |
| name: Java/C++ gRPC Tests | |
| needs: changes | |
| if: > | |
| needs.changes.outputs.grpc_tests == 'true' || | |
| needs.changes.outputs.cpp_code == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Install gRPC C++ development package | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --yes libgrpc++-dev protobuf-compiler-grpc | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Install Java artifacts for gRPC tests | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Generate gRPC test sources | |
| run: python integration_tests/grpc_tests/generate_grpc.py | |
| - name: Build C++ gRPC peer | |
| run: | | |
| cmake -S integration_tests/grpc_tests/cpp -B integration_tests/grpc_tests/cpp/build -DCMAKE_BUILD_TYPE=Release | |
| cmake --build integration_tests/grpc_tests/cpp/build --parallel | |
| - name: Run Java/C++ gRPC tests | |
| run: | | |
| cd integration_tests/grpc_tests/java | |
| mvn -T16 --no-transfer-progress -Dtest=CppGrpcTest test | |
| grpc_java_kotlin_tests: | |
| name: Java/Kotlin gRPC Tests | |
| needs: changes | |
| if: needs.changes.outputs.grpc_tests == 'true' || needs.changes.outputs.kotlin == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Install Java artifacts for gRPC tests | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Install Kotlin artifacts for gRPC tests | |
| run: | | |
| cd kotlin | |
| mvn -T16 --batch-mode --no-transfer-progress -pl fory-kotlin,fory-kotlin-ksp -am -DskipTests install | |
| - name: Generate gRPC test sources | |
| run: python integration_tests/grpc_tests/generate_grpc.py | |
| - name: Build Kotlin gRPC peer | |
| run: | | |
| cd integration_tests/grpc_tests/kotlin | |
| mvn --no-transfer-progress -DskipTests package | |
| - name: Run Java/Kotlin gRPC Tests | |
| run: | | |
| cd integration_tests/grpc_tests/java | |
| mvn -T16 --no-transfer-progress -Dtest=KotlinGrpcTest test | |
| grpc_java_dart_tests: | |
| name: Java/Dart gRPC Tests | |
| needs: changes | |
| if: needs.changes.outputs.grpc_tests == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Set up Dart | |
| uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260 # v1.7.2 | |
| with: | |
| sdk: stable | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Install Java artifacts for gRPC tests | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Generate gRPC test sources | |
| run: python integration_tests/grpc_tests/generate_grpc.py | |
| - name: Build Dart gRPC peer | |
| run: | | |
| cd integration_tests/grpc_tests/dart | |
| dart pub get | |
| dart run build_runner build | |
| - name: Analyze and format-check generated Dart gRPC companions | |
| run: | | |
| cd integration_tests/grpc_tests/dart | |
| dart analyze bin lib/generated/*/*_grpc.dart | |
| dart format --output=none --set-exit-if-changed bin lib/generated/*/*_grpc.dart | |
| - name: Run Java/Dart gRPC Tests | |
| run: | | |
| cd integration_tests/grpc_tests/java | |
| mvn -T16 --no-transfer-progress -Dtest=DartGrpcTest test | |
| javascript: | |
| name: JavaScript CI | |
| needs: changes | |
| if: needs.changes.outputs.javascript == 'true' | |
| strategy: | |
| matrix: | |
| node-version: [18, 24] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache-dependency-path: javascript/package-lock.json | |
| cache: "npm" | |
| - 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. On Windows, use 3.11 to avoid | |
| # the slower 3.8 download on hosted runners. | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ runner.os == 'Windows' && '3.11' || '3.8' }} | |
| - name: Run CI with NodeJS | |
| run: python ./ci/run_ci.py javascript | |
| javascript_xlang: | |
| name: JavaScript Xlang Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Cache npm local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-npm-${{ hashFiles('javascript/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-npm- | |
| - name: Install JavaScript dependencies | |
| run: | | |
| cd javascript | |
| npm install | |
| npm run build | |
| - name: Run JavaScript Xlang Test | |
| env: | |
| FORY_JAVASCRIPT_JAVA_CI: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn --no-transfer-progress test -Dtest=org.apache.fory.xlang.JavaScriptXlangTest -DforkCount=0 | |
| - name: Run JavaScript IDL Tests | |
| run: ./integration_tests/idl_tests/run_javascript_tests.sh | |
| rust: | |
| name: Rust CI | |
| needs: changes | |
| strategy: | |
| matrix: | |
| # macos-14 is the arm64 runner; keep it for Rust code changes only. | |
| os: ${{ fromJSON(needs.changes.outputs.rust == 'true' && '["ubuntu-latest","macos-14","macos-latest"]' || '["ubuntu-latest","macos-latest"]') }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Set up Java 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 11 | |
| distribution: temurin | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Cache Cargo dependencies | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: rust | |
| cache-bin: "false" | |
| - name: Run Rust CI | |
| run: python ./ci/run_ci.py rust | |
| rust_xlang: | |
| name: Rust Xlang Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Cache Cargo dependencies | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: rust | |
| cache-bin: "false" | |
| - name: Run Rust Xlang Test | |
| env: | |
| FORY_RUST_JAVA_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.RustXlangTest | |
| - name: Run Rust IDL Tests | |
| run: ./integration_tests/idl_tests/run_rust_tests.sh | |
| cpp: | |
| name: C++ CI | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Set up Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| bazelisk-version: "1.x" | |
| - name: Compute Bazel C++ toolchain cache key | |
| id: bazel-cpp-toolchain | |
| shell: bash | |
| run: | | |
| { | |
| echo "runner-os=${RUNNER_OS}" | |
| echo "runner-arch=${RUNNER_ARCH}" | |
| if [[ "${RUNNER_OS}" == "macOS" ]]; then | |
| xcode-select -p | |
| xcrun --sdk macosx --show-sdk-path | |
| xcrun --find clang++ | |
| xcodebuild -version | |
| else | |
| command -v gcc || true | |
| gcc --version || true | |
| command -v g++ || true | |
| g++ --version || true | |
| fi | |
| } > bazel-cpp-toolchain-key.txt | |
| echo "key=$(shasum -a 256 bazel-cpp-toolchain-key.txt | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Bazel repository cache | |
| uses: actions/cache@v4 | |
| with: | |
| # setup-bazel uses ~/.bazel on GitHub-hosted runners. | |
| # local_config_cc records absolute host compiler and SDK include roots. | |
| path: | | |
| ~/.bazel/external | |
| ~/.cache/bazel/_bazel_*/*/external | |
| ~/Library/Caches/bazel/_bazel_*/*/external | |
| ~/Library/Caches/bazel/external | |
| C:\users\runneradmin\.bazel\external | |
| C:\users\runneradmin\_bazel_runneradmin\*/external | |
| key: bazel-repo-${{ runner.os }}-${{ runner.arch }}-py311-${{ steps.bazel-cpp-toolchain.outputs.key }}-${{ hashFiles('MODULE.bazel', 'MODULE.bazel.lock', 'WORKSPACE', '.bazelversion', '.bazelrc', 'bazel/**') }} | |
| restore-keys: | | |
| bazel-repo-${{ runner.os }}-${{ runner.arch }}-py311-${{ steps.bazel-cpp-toolchain.outputs.key }}- | |
| - name: Cache Bazel build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| # setup-bazel uses ~/.bazel on GitHub-hosted runners. | |
| # Keep host toolchain identity in the key so depfiles generated with | |
| # one Xcode/SDK path are not restored under another macOS image. | |
| path: | | |
| ~/.bazel | |
| ~/.cache/bazel | |
| ~/Library/Caches/bazel | |
| C:\users\runneradmin\.bazel | |
| C:\users\runneradmin\_bazel_runneradmin | |
| key: bazel-build-cpp-${{ runner.os }}-${{ runner.arch }}-${{ steps.bazel-cpp-toolchain.outputs.key }}-${{ hashFiles('cpp/**', 'BUILD', 'WORKSPACE', 'MODULE.bazel', 'MODULE.bazel.lock', '.bazelversion', '.bazelrc', 'bazel/**') }} | |
| - name: Run C++ CI with Bazel | |
| run: python ./ci/run_ci.py cpp | |
| - name: Upload Bazel Test Logs | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: bazel-test-logs-${{ matrix.os }} | |
| path: | | |
| bazel-out/*/testlogs/**/*.log | |
| bazel-out/*/testlogs/**/*.xml | |
| if-no-files-found: ignore | |
| cpp_windows: | |
| name: C++ CI (windows-2022) | |
| needs: changes | |
| if: needs.changes.outputs.cpp == 'true' | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Set up Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| bazelisk-version: "1.x" | |
| - name: Cache Bazel repository cache | |
| uses: actions/cache@v4 | |
| with: | |
| # setup-bazel uses ~/.bazel on GitHub-hosted runners. | |
| path: | | |
| C:\users\runneradmin\.bazel\external | |
| C:\users\runneradmin\_bazel_runneradmin\*/external | |
| key: bazel-repo-${{ runner.os }}-${{ runner.arch }}-py311-${{ hashFiles('WORKSPACE', '.bazelrc', 'bazel/**') }} | |
| restore-keys: | | |
| bazel-repo-${{ runner.os }}-${{ runner.arch }}-py311- | |
| - name: Cache Bazel build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| # setup-bazel uses ~/.bazel on GitHub-hosted runners. | |
| path: | | |
| C:\users\runneradmin\.bazel | |
| C:\users\runneradmin\_bazel_runneradmin | |
| key: bazel-build-cpp-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('cpp/**', 'BUILD', 'WORKSPACE') }} | |
| - name: Run C++ CI with Bazel | |
| run: python ./ci/run_ci.py cpp | |
| - name: Upload Bazel Test Logs | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: bazel-test-logs-windows-2022 | |
| path: | | |
| bazel-out/*/testlogs/**/*.log | |
| bazel-out/*/testlogs/**/*.xml | |
| if-no-files-found: ignore | |
| cpp_sanitizers: | |
| name: C++ Sanitizer (${{ matrix.sanitizer }}) | |
| needs: changes | |
| if: needs.changes.outputs.cpp_code == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| sanitizer: [asan, ubsan] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Set up Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| bazelisk-version: "1.x" | |
| - name: Cache Bazel repository cache | |
| uses: actions/cache@v4 | |
| with: | |
| # setup-bazel uses ~/.bazel on GitHub-hosted runners. | |
| path: | | |
| ~/.bazel/external | |
| ~/.cache/bazel/_bazel_*/*/external | |
| key: bazel-repo-sanitizer-${{ runner.os }}-${{ runner.arch }}-py311-${{ hashFiles('WORKSPACE', '.bazelrc', 'bazel/**') }} | |
| restore-keys: | | |
| bazel-repo-sanitizer-${{ runner.os }}-${{ runner.arch }}-py311- | |
| - name: Cache Bazel build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| # setup-bazel uses ~/.bazel on GitHub-hosted runners. | |
| path: | | |
| ~/.bazel | |
| ~/.cache/bazel | |
| key: bazel-build-cpp-sanitizer-${{ runner.os }}-${{ runner.arch }}-${{ matrix.sanitizer }}-${{ hashFiles('cpp/**', 'BUILD', 'WORKSPACE', '.bazelrc') }} | |
| - name: Install Bazel and C++ deps | |
| run: python ./ci/run_ci.py cpp --install-deps-only | |
| - name: Run C++ ${{ matrix.sanitizer }} tests | |
| run: | | |
| ARCH="$(uname -m)" | |
| BAZEL_CONFIGS="--config=fory_cpp_werror --config=${{ matrix.sanitizer }}" | |
| if [[ "${ARCH}" == "x86_64" || "${ARCH}" == "amd64" ]]; then | |
| BAZEL_CONFIGS="--config=x86_64 ${BAZEL_CONFIGS}" | |
| fi | |
| TEST_TARGETS=( | |
| //cpp/fory/util:buffer_test | |
| //cpp/fory/util:error_test | |
| //cpp/fory/util:logging_test | |
| //cpp/fory/util:result_test | |
| //cpp/fory/meta:enum_info_test | |
| //cpp/fory/meta:field_info_test | |
| //cpp/fory/meta:meta_string_test | |
| //cpp/fory/meta:type_traits_test | |
| //cpp/fory/row:row_test | |
| //cpp/fory/encoder:row_encoder_test | |
| //cpp/fory/serialization:serialization_test | |
| //cpp/fory/serialization:namespace_macro_test | |
| //cpp/fory/serialization:stream_test | |
| ) | |
| bazel test --cache_test_results=no ${BAZEL_CONFIGS} "${TEST_TARGETS[@]}" | |
| - name: Upload Bazel Test Logs (${{ matrix.sanitizer }}) | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: bazel-test-logs-${{ matrix.sanitizer }} | |
| path: | | |
| bazel-out/*/testlogs/**/*.log | |
| bazel-out/*/testlogs/**/*.xml | |
| if-no-files-found: ignore | |
| cpp_xlang: | |
| name: CPP Xlang Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Set up Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| bazelisk-version: "1.x" | |
| - name: Run CPP Xlang Test | |
| env: | |
| FORY_CPP_JAVA_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.CPPXlangTest | |
| cpp_idl: | |
| name: C++ IDL Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Cache C++ IDL CMake build | |
| id: cpp-idl-cmake-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: integration_tests/idl_tests/cpp/build | |
| key: cpp-idl-cmake-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('integration_tests/idl_tests/cpp/**', 'integration_tests/idl_tests/*.fdl', 'integration_tests/idl_tests/generate_idl.py', 'compiler/**', 'cpp/**') }} | |
| restore-keys: | | |
| cpp-idl-cmake-${{ runner.os }}-${{ runner.arch }}- | |
| save-always: true | |
| - name: Install Java artifacts for IDL tests | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| - name: Run C++ IDL Tests | |
| env: | |
| FORY_CPP_IDL_SKIP_BUILD: ${{ steps.cpp-idl-cmake-cache.outputs.cache-hit == 'true' && '1' || '' }} | |
| run: ./integration_tests/idl_tests/run_cpp_tests.sh | |
| cpp_examples: | |
| name: C++ Examples | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Set up Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| bazelisk-version: "1.x" | |
| - name: Build and run C++ hello_world example (CMake) | |
| run: | | |
| cd examples/cpp/hello_world | |
| ./run.sh | |
| - name: Build and run C++ hello_row example (CMake) | |
| run: | | |
| cd examples/cpp/hello_row | |
| ./run.sh | |
| - name: Build and run C++ hello_world example (Bazel) | |
| run: | | |
| cd examples/cpp/hello_world | |
| ./run_bazel.sh | |
| - name: Build and run C++ hello_row example (Bazel) | |
| run: | | |
| cd examples/cpp/hello_row | |
| ./run_bazel.sh | |
| python: | |
| name: Python CI | |
| needs: changes | |
| if: needs.changes.outputs.python == 'true' || needs.changes.outputs.cpp == 'true' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| python-version: ["3.8", "3.12", "3.14"] | |
| os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Set up Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| bazelisk-version: "1.x" | |
| - name: Clean Bazel cache (Windows) | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| echo "Cleaning Bazel cache to ensure fresh build..." | |
| bazel clean --expunge || true | |
| - name: Run Python CI | |
| shell: bash | |
| env: | |
| ENABLE_FORY_CYTHON_SERIALIZATION: "1" | |
| run: python ./ci/run_ci.py python | |
| - name: Run Python tests (ENABLE_FORY_CYTHON_SERIALIZATION=0) | |
| shell: bash | |
| env: | |
| ENABLE_FORY_CYTHON_SERIALIZATION: "0" | |
| run: | | |
| cd python | |
| pytest -v -s --durations=60 pyfory/tests | |
| python_windows: | |
| name: Python CI (${{ matrix.python-version }}, windows-2022) | |
| needs: changes | |
| if: needs.changes.outputs.python == 'true' || needs.changes.outputs.cpp == 'true' | |
| runs-on: windows-2022 | |
| strategy: | |
| matrix: | |
| # windows-2022 runners don't have Python 3.8 preinstalled; keep this | |
| # matrix compact while covering the latest Python version. | |
| python-version: ["3.11", "3.12", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Set up Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| bazelisk-version: "1.x" | |
| - name: Clean Bazel cache (Windows) | |
| shell: bash | |
| run: | | |
| echo "Cleaning Bazel cache to ensure fresh build..." | |
| bazel clean --expunge || true | |
| - name: Run Python CI | |
| shell: bash | |
| env: | |
| ENABLE_FORY_CYTHON_SERIALIZATION: "1" | |
| run: python ./ci/run_ci.py python | |
| - name: Run Python tests (ENABLE_FORY_CYTHON_SERIALIZATION=0) | |
| shell: bash | |
| env: | |
| ENABLE_FORY_CYTHON_SERIALIZATION: "0" | |
| run: | | |
| cd python | |
| pytest -v -s --durations=60 pyfory/tests | |
| python_xlang: | |
| name: Python Xlang Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Install pyfory | |
| run: bash ci/run_ci.sh install_pyfory | |
| - name: Run Python Xlang Test | |
| env: | |
| FORY_PYTHON_JAVA_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.PythonXlangTest | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.PyCrossLanguageTest | |
| cd ../fory-format | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.format.CrossLanguageTest | |
| - name: Run Python IDL Tests | |
| run: ./integration_tests/idl_tests/run_python_tests.sh | |
| go: | |
| name: Golang CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Go 1.23 | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "1.23" | |
| - name: Display Go version | |
| run: go version | |
| - name: Set up Python3.8 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| cache: "pip" | |
| - name: Set up Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| bazelisk-version: "1.x" | |
| - name: Install python dependencies | |
| run: pip install pyarrow cython wheel pytest setuptools -U | |
| - name: Install pyfory for xlang tests | |
| run: pip install -e python/ | |
| - name: Run Golang CI | |
| run: python ./ci/run_ci.py go | |
| go_xlang: | |
| name: Go Xlang Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.21" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Run Go Xlang Test | |
| env: | |
| FORY_GO_JAVA_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.GoXlangTest | |
| - name: Run Go IDL Tests | |
| run: ./integration_tests/idl_tests/run_go_tests.sh | |
| kotlin_xlang: | |
| name: Kotlin Xlang Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Run Kotlin Xlang Test | |
| env: | |
| FORY_KOTLIN_JAVA_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.KotlinXlangTest | |
| android_go_xlang: | |
| name: Android Go Xlang Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.21" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Run Android Go Xlang And IDL Tests | |
| env: | |
| FORY_ANDROID_ENABLED: "1" | |
| FORY_GO_JAVA_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.GoXlangTest | |
| cd ../.. | |
| ./integration_tests/idl_tests/run_go_tests.sh | |
| - name: Run Android Go Xlang And IDL Tests With Static Generated Serializers | |
| env: | |
| FORY_ANDROID_ENABLED: "1" | |
| FORY_GO_JAVA_CI: "1" | |
| FORY_STATIC_PROCESSOR_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: python ./ci/run_ci.py android-go-xlang-static-processor | |
| android_serializer: | |
| name: Android Serializer JVM Round Trip Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Run Android Serializer JVM Round Trip Test | |
| env: | |
| FORY_ANDROID_ENABLED: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.serializer.AndroidJvmRoundTripTest | |
| dart_xlang: | |
| name: Dart Xlang Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache Maven local repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Install Dart SDK | |
| run: | | |
| DART_VERSION=3.10.7 | |
| wget -q https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip | |
| unzip -q dartsdk-linux-x64-release.zip | |
| echo "$PWD/dart-sdk/bin" >> $GITHUB_PATH | |
| - name: Display Dart version | |
| run: dart --version | |
| - name: Get Dart dependencies | |
| run: | | |
| cd dart | |
| dart pub get | |
| - name: Generate Dart code | |
| run: | | |
| ( | |
| cd dart/packages/fory | |
| dart run build_runner build | |
| ) | |
| ( | |
| cd dart/packages/inheritance-test-models | |
| dart run build_runner build | |
| ) | |
| ( | |
| cd dart/packages/fory-test | |
| dart run build_runner build | |
| ) | |
| - name: Run Dart Xlang Test | |
| env: | |
| FORY_DART_JAVA_CI: "1" | |
| ENABLE_FORY_DEBUG_OUTPUT: "1" | |
| run: | | |
| cd java | |
| mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true | |
| cd fory-core | |
| mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.DartXlangTest | |
| dart: | |
| name: Dart CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Dart SDK | |
| run: | | |
| # Download and install Dart SDK | |
| DART_VERSION=3.10.7 | |
| wget -q https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip | |
| unzip -q dartsdk-linux-x64-release.zip | |
| export PATH="$PATH:$PWD/dart-sdk/bin" | |
| echo "$PWD/dart-sdk/bin" >> $GITHUB_PATH | |
| - name: Display Dart version | |
| run: dart --version | |
| - name: Get dependencies | |
| run: | | |
| cd dart | |
| dart pub get | |
| - name: Generate code | |
| run: | | |
| ( | |
| cd dart/packages/fory | |
| dart run build_runner build | |
| ) | |
| ( | |
| cd dart/packages/inheritance-test-models | |
| dart run build_runner build | |
| ) | |
| ( | |
| cd dart/packages/fory-test | |
| dart run build_runner build | |
| ) | |
| - name: Run VM tests | |
| run: | | |
| ( | |
| cd dart/packages/fory | |
| dart test | |
| ) | |
| ( | |
| cd dart/packages/fory-test | |
| dart test | |
| ) | |
| - name: Run inheritance AOT and JavaScript smoke | |
| run: | | |
| cd dart/packages/fory-test | |
| dart compile exe \ | |
| -o "$RUNNER_TEMP/fory_inheritance_smoke" \ | |
| tool/inheritance_smoke.dart | |
| "$RUNNER_TEMP/fory_inheritance_smoke" | |
| dart compile js --fatal-warnings --no-source-maps -O2 \ | |
| -o "$RUNNER_TEMP/fory_inheritance_smoke.js" \ | |
| tool/inheritance_smoke.dart | |
| node "$RUNNER_TEMP/fory_inheritance_smoke.js" | |
| - name: Run web tests | |
| run: | | |
| cd dart/packages/fory | |
| dart test -p chrome | |
| - name: Run code analysis | |
| run: | | |
| cd dart/packages/fory-test | |
| dart analyze | |
| - name: Analyze code | |
| run: | | |
| cd dart | |
| dart analyze | |
| dart_flutter: | |
| name: Dart Flutter CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set Flutter smoke dir | |
| run: echo "FLUTTER_SMOKE_DIR=$RUNNER_TEMP/fory_flutter_smoke" >> "$GITHUB_ENV" | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| - name: Install Flutter Linux desktop dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build libgtk-3-dev | |
| - name: Display Flutter version | |
| run: flutter --version | |
| - name: Create Flutter smoke app | |
| run: | | |
| rm -rf "$FLUTTER_SMOKE_DIR" | |
| flutter create --empty --project-name fory_flutter_smoke "$FLUTTER_SMOKE_DIR" | |
| - name: Configure Flutter smoke app | |
| run: | | |
| mkdir -p "$FLUTTER_SMOKE_DIR/lib" "$FLUTTER_SMOKE_DIR/test" | |
| cat <<EOF | sed 's/^ //' > "$FLUTTER_SMOKE_DIR/pubspec.yaml" | |
| name: fory_flutter_smoke | |
| description: Flutter smoke app for Apache Fory CI. | |
| publish_to: none | |
| environment: | |
| sdk: ^3.6.1 | |
| dependencies: | |
| flutter: | |
| sdk: flutter | |
| fory: | |
| path: ${GITHUB_WORKSPACE}/dart/packages/fory | |
| dev_dependencies: | |
| flutter_test: | |
| sdk: flutter | |
| flutter_lints: ^5.0.0 | |
| build_runner: ^2.4.13 | |
| flutter: | |
| uses-material-design: true | |
| EOF | |
| cat <<'EOF' | sed 's/^ //' > "$FLUTTER_SMOKE_DIR/lib/person.dart" | |
| import 'package:fory/fory.dart'; | |
| part 'person.fory.dart'; | |
| @ForyStruct() | |
| class Person { | |
| Person(); | |
| String name = ''; | |
| @ForyField(type: Int32Type()) | |
| int age = 0; | |
| } | |
| EOF | |
| cat <<'EOF' | sed 's/^ //' > "$FLUTTER_SMOKE_DIR/lib/main.dart" | |
| import 'package:flutter/material.dart'; | |
| import 'person.dart'; | |
| void main() { | |
| final person = Person()..name = 'Ada'; | |
| runApp( | |
| Directionality( | |
| textDirection: TextDirection.ltr, | |
| child: Text(person.name), | |
| ), | |
| ); | |
| } | |
| EOF | |
| cat <<'EOF' | sed 's/^ //' > "$FLUTTER_SMOKE_DIR/test/fory_smoke_test.dart" | |
| import 'package:flutter_test/flutter_test.dart'; | |
| import 'package:fory/fory.dart'; | |
| import 'package:fory_flutter_smoke/person.dart'; | |
| void main() { | |
| test('generated fory serializers work in flutter', () { | |
| final fory = Fory(); | |
| PersonForyModule.register(fory, Person, id: 1); | |
| final person = Person() | |
| ..name = 'Ada' | |
| ..age = 36; | |
| final bytes = fory.serialize(person); | |
| final roundTrip = fory.deserialize<Person>(bytes); | |
| expect(roundTrip.name, 'Ada'); | |
| expect(roundTrip.age, 36); | |
| }); | |
| } | |
| EOF | |
| - name: Get Flutter dependencies | |
| run: | | |
| cd "$FLUTTER_SMOKE_DIR" | |
| flutter pub get | |
| - name: Generate Flutter smoke code | |
| run: | | |
| cd "$FLUTTER_SMOKE_DIR" | |
| dart run build_runner build | |
| - name: Run Flutter smoke tests | |
| run: | | |
| cd "$FLUTTER_SMOKE_DIR" | |
| flutter test | |
| - name: Analyze Flutter smoke app | |
| run: | | |
| cd "$FLUTTER_SMOKE_DIR" | |
| flutter analyze | |
| - name: Build Flutter smoke app (AOT) | |
| run: | | |
| flutter config --enable-linux-desktop | |
| cd "$FLUTTER_SMOKE_DIR" | |
| flutter build linux --release | |
| lint: | |
| name: Code Style Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - 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: Test release documentation updater | |
| run: python -m unittest ci.test_release | |
| - name: Set up .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - name: Register Checkstyle problem matcher | |
| run: echo "::add-matcher::.github/maven-style-matcher.json" | |
| - name: Check code style | |
| run: python ./ci/run_ci.py format | |
| validate_fory_site_build: | |
| name: Validate Fory Site Build | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'apache/fory' && (github.event_name != 'pull_request' || !github.event.pull_request.draft) | |
| steps: | |
| - name: Checkout fory | |
| uses: actions/checkout@v5 | |
| with: | |
| path: fory | |
| - name: Checkout fory-site | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: apache/fory-site | |
| ref: main | |
| path: fory-site | |
| - name: Set up Node.js 24.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24.x | |
| cache: npm | |
| cache-dependency-path: fory-site/package-lock.json | |
| - name: Install fory-site dependencies | |
| working-directory: fory-site | |
| run: npm ci --prefer-offline --fund=false | |
| - name: Restore Docusaurus cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: fory-site/node_modules/.cache | |
| key: ${{ runner.os }}-node24-docusaurus-${{ hashFiles('fory-site/package-lock.json') }} | |
| - name: Test fory-site validator | |
| working-directory: fory | |
| run: python3 -m unittest ci.test_validate_fory_site_sync | |
| - name: Sync files and validate site build | |
| run: | | |
| python3 fory/ci/validate_fory_site_sync.py fory fory-site |