[Build]: Configure JNI build for use in Java on Linux/MacOS #4
Workflow file for this run
This file contains 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
name: JNI Linux | |
on: | |
push: | |
branches: [ dev, master ] | |
pull_request: | |
branches: [ dev, master ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install system dependencies | |
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 | |
env: | |
CC: /usr/bin/clang | |
CXX: /usr/bin/clang++ | |
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 | |
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 | |
run: | | |
ninja -Cbuild | |
env: | |
CC: /usr/bin/clang | |
CXX: /usr/bin/clang++ |