ci: upgrade action with node 24 #1404
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
| # SPDX-FileCopyrightText: 2015 - 2024 Rime community | |
| # | |
| # SPDX-License-Identifier: GPL-3.0-or-later | |
| name: Pull Request | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| # pull request's head branch was updated | |
| - synchronize | |
| env: | |
| CI_NAME: Pull Request CI | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-24.04 | |
| - macos-15 | |
| - windows-2025 | |
| env: | |
| BUILD_ABI: armeabi-v7a,arm64-v8a,x86,x86_64 | |
| steps: | |
| - name: Fetch source code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Get branch name | |
| id: vars | |
| shell: bash | |
| run: | | |
| echo ${GITHUB_REF#refs/*/} | |
| echo CI_BRANCH=${GITHUB_REF#refs/*/} >> $GITHUB_ENV | |
| - name: Setup Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: "temurin" | |
| java-version: 17 | |
| # will restore cache of dependencies and wrappers | |
| cache: 'gradle' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Android NDK | |
| run: | | |
| sdkmanager --install "cmake;3.31.6" | |
| - name: Calculate JNI cache hash | |
| id: cache-hash | |
| run: | | |
| ./gradlew :app:calculateNativeCacheHash | |
| - name: Fetch JNI cache | |
| uses: actions/cache@v5 | |
| id: jni-cache | |
| with: | |
| path: "app/prebuilt" | |
| key: ${{ matrix.os }}-trime-jni-debug-${{ steps.cache-hash.outputs.native-cache-hash }} | |
| - name: Fetch submodules | |
| if: ${{ !steps.jni-cache.outputs.cache-hit }} | |
| run: | | |
| git submodule update --init --recursive | |
| - name: Check code style | |
| if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
| run: | | |
| make style-lint | |
| - name: Build debug Trime | |
| run: | | |
| make debug | |
| - name: Add JNI cache | |
| if: ${{ !steps.jni-cache.outputs.cache-hit }} | |
| shell: bash | |
| run: cp -R app/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib app/prebuilt | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: trime-${{ matrix.os }} | |
| path: app/build/outputs/apk/debug/ | |
| # keep 30 days | |
| retention-days: 30 |