From 09a5cacac8bc95880efa1c3fc51e7b78a97611fb Mon Sep 17 00:00:00 2001 From: Satoshi Otomakan Date: Mon, 4 Sep 2023 17:52:07 +0200 Subject: [PATCH] [build]: Add JNI MacOS workflow --- .../{linux-ci-jni.yml => jni-linux.yml} | 8 ++- .github/workflows/jni-macos.yml | 58 +++++++++++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) rename .github/workflows/{linux-ci-jni.yml => jni-linux.yml} (97%) create mode 100644 .github/workflows/jni-macos.yml diff --git a/.github/workflows/linux-ci-jni.yml b/.github/workflows/jni-linux.yml similarity index 97% rename from .github/workflows/linux-ci-jni.yml rename to .github/workflows/jni-linux.yml index 42f465d8425..d679be2f8fc 100644 --- a/.github/workflows/linux-ci-jni.yml +++ b/.github/workflows/jni-linux.yml @@ -1,4 +1,4 @@ -name: Linux CI JNI +name: JNI Linux on: push: @@ -20,12 +20,14 @@ jobs: run: | tools/install-sys-dependencies-linux tools/install-rust-dependencies + - name: Cache internal dependencies id: internal_cache uses: actions/cache@v3 with: path: build/local key: ${{ runner.os }}-internal-${{ hashFiles('tools/install-dependencies') }} + - name: Install internal dependencies run: | tools/install-dependencies @@ -46,13 +48,15 @@ jobs: env: CC: /usr/bin/clang CXX: /usr/bin/clang++ + - name: CMake (Java, Kotlin) run: | cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DTW_UNITY_BUILD=ON -DTW_COMPILE_JAVA=ON -DTW_COMPILE_KOTLIN=ON -GNinja env: CC: /usr/bin/clang CXX: /usr/bin/clang++ - - name: Build and test + + - name: Build run: | ninja -Cbuild env: diff --git a/.github/workflows/jni-macos.yml b/.github/workflows/jni-macos.yml new file mode 100644 index 00000000000..33d0579abc5 --- /dev/null +++ b/.github/workflows/jni-macos.yml @@ -0,0 +1,58 @@ +name: JNI MacOS + +on: + push: + branches: [ dev, master ] + pull_request: + branches: [ dev, master ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: [ self-hosted, macOS, ARM64, wallet-core ] + if: github.event.pull_request.draft == false + steps: + - uses: actions/checkout@v3 + - name: Install system dependencies + run: | + tools/install-sys-dependencies-mac + tools/install-rust-dependencies + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Cache internal dependencies + id: internal_cache + uses: actions/cache@v3 + with: + path: build/local + key: ${{ runner.os }}-internal-${{ hashFiles('tools/install-dependencies') }} + + - name: Install internal dependencies + run: | + tools/install-dependencies + if: steps.internal_cache.outputs.cache-hit != 'true' + + - name: Cache Rust + uses: Swatinem/rust-cache@v2 + with: + workspaces: | + rust + + - name: Code generation + run: | + tools/generate-files native + + - name: CMake (Java, Kotlin) + run: | + cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DTW_UNITY_BUILD=ON -DTW_COMPILE_JAVA=ON -DTW_COMPILE_KOTLIN=ON -GNinja + + - name: Build + run: | + ninja -Cbuild