Skip to content

build

build #25

Workflow file for this run

name: "build"
on:
push:
branches:
- main
pull_request:
repository_dispatch:
types:
- trigger_build
workflow_dispatch:
workflow_call:
schedule:
- cron: '0 0 * * 1'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# build natively on desktop
desktop:
strategy:
fail-fast: false
matrix:
include:
# latest tested JDK
- os: linux
image: ubuntu-latest
jdk: 21
jacoco: yes
- os: osx
image: macos-latest
jdk: 21
jacoco: no
# oldest supported JDK
- os: linux
image: ubuntu-latest
jdk: 17
jacoco: no
- os: osx
image: macos-latest
jdk: 17
jacoco: no
name: desktop/${{ matrix.os }}-jdk${{ matrix.jdk }}
runs-on: ${{ matrix.image }}
env:
# TODO: set to master
ROC_REVISION: v0.3.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
- name: Install system dependencies
run: scripts/${{ matrix.os }}/install_dependencies.sh
- name: Install Roc
run: scripts/${{ matrix.os }}/build_roc.sh
- name: Build and test bindings
run: scripts/${{ matrix.os }}/build_bindings.sh
- name: Upload test coverage
if: ${{ github.repository_owner == 'roc-streaming' && matrix.jacoco == 'yes' }}
id: jacoco
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
# build for Android on Linux (with Docker)
android-linux:
strategy:
fail-fast: false
matrix:
include:
# latest tested JDK, SDK, and NDK
- jdk: 21
sdk: 34
api: 29
ndk_r: 26d
ndk: 26.3.11579264
# oldest supported JDK, SDK, and NDK
- jdk: 17
sdk: 31
api: 29
ndk_r: 21e
ndk: 21.4.7075529
name: android/linux-jdk${{ matrix.jdk }}-sdk${{ matrix.sdk }}-ndk${{ matrix.ndk_r }}
runs-on: ubuntu-24.04
env:
# TODO: set to master
ROC_REVISION: v0.3.0
JAVA_VERSION: ${{ matrix.jdk }}
SDK_LEVEL: ${{ matrix.sdk }}
API_LEVEL: ${{ matrix.api }}
NDK_VERSION: ${{ matrix.ndk }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: scripts/android_docker.sh build
# build for Android on macOS
android-osx:
strategy:
fail-fast: false
matrix:
include:
# latest tested JDK, SDK, and NDK
- jdk: 21
sdk: 34
api: 29
ndk_r: 26d
ndk: 26.3.11579264
cmdline_tools: 10406996
build_tools: 35.0.0
cmake: 3.18.1
avd_image: default
avd_arch: x86_64
# oldest tested JDK, SDK, and NDK
- jdk: 17
sdk: 31
api: 29
ndk_r: 21e
ndk: 21.4.7075529
cmdline_tools: 10406996
build_tools: 28.0.3
cmake: 3.10.2.4988404
avd_image: default
avd_arch: x86_64
name: android/osx-jdk${{ matrix.jdk }}-sdk${{ matrix.sdk }}-ndk${{ matrix.ndk_r }}
runs-on: macos-13
env:
# TODO: set to master
ROC_REVISION: v0.3.0
SDK_LEVEL: ${{ matrix.sdk }}
API_LEVEL: ${{ matrix.api }}
NDK_VERSION: ${{ matrix.ndk }}
BUILD_TOOLS_VERSION: ${{ matrix.build_tools }}
CMAKE_VERSION: ${{ matrix.cmake }}
AVD_IMAGE: ${{ matrix.avd_image }}
AVD_ARCH: ${{ matrix.avd_arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
- name: Install Android SDK
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: ${{ matrix.cmdline_tools }}
- name: Install Android packages
run: |
sdkmanager \
"platforms;android-${{ matrix.sdk }}" \
"build-tools;${{ matrix.build_tools }}" \
"ndk;${{ matrix.ndk }}" \
"cmake;${{ matrix.cmake }}" \
"system-images;android-${{ matrix.sdk }};${{ matrix.avd_image }};${{ matrix.avd_arch }}" \
"emulator"
- name: Install system dependencies
run: scripts/android/install_dependencies.sh
- name: Build Roc
run: scripts/android/build_roc.sh
- name: Build bindings
run: scripts/android/build_bindings.sh
- name: Run Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api }}
arch: ${{ matrix.avd_arch }}
target: ${{ matrix.avd_image }}
avd-name: roc_device
ndk: ${{ matrix.ndk }}
cmake: ${{ matrix.cmake }}
script: ./scripts/android/run_instrumented_tests.sh