Android #29
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
name: build | |
on: | |
pull_request: {} | |
workflow_dispatch: {} | |
push: | |
branches: | |
- 'main' | |
tags-ignore: | |
- '**' | |
env: | |
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" | |
jobs: | |
zig: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: mlugg/setup-zig@475c97be87a204e6c57fe851f970bd02005a70f0 # ratchet:mlugg/setup-zig@v2 | |
with: | |
version: 0.14.0 | |
- run: zig build -p src/jvmMain/resources/jni | |
working-directory: okio-zstd | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4 | |
with: | |
name: jni-binaries | |
path: okio-zstd/src/jvmMain/resources/jni | |
if-no-files-found: error | |
platform-tests: | |
needs: | |
- zig | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- os: macos-latest | |
task: macosArm64Test | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # ratchet:actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version-file: .github/workflows/.java-version | |
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4 | |
with: | |
name: jni-binaries | |
path: okio-zstd/src/jvmMain/resources/jni | |
- run: ./gradlew jvmTest ${{ matrix.platform.task }} apiCheck --stacktrace | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: test-report-${{ matrix.platform.os }} | |
path: '**/build/reports/tests/**' | |
retention-days: 1 | |
android-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # ratchet:actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version-file: .github/workflows/.java-version | |
- 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 | |
- run: ./gradlew assembleAndroidTest | |
- uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # ratchet:reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
emulator-boot-timeout: 20000 | |
script: ./gradlew connectedCheck | |
build: | |
runs-on: macos-latest | |
needs: | |
- platform-tests | |
- android-tests | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # ratchet:actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version-file: .github/workflows/.java-version | |
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4 | |
with: | |
name: jni-binaries | |
path: okio-zstd/src/jvmMain/resources/jni | |
- run: ./gradlew assemble :dokkaHtmlMultiModule | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4 | |
with: | |
name: html-docs | |
path: build/dokka/htmlMultiModule/ | |
if-no-files-found: error | |
- run: ./gradlew publishToMavenCentral | |
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'square/okio-zstd' }} | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }} | |
- name: Deploy docs to website | |
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'square/okio-zstd' }} | |
uses: JamesIves/github-pages-deploy-action@132898c54c57c7cc6b80eb3a89968de8fc283505 # ratchet:JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: site | |
FOLDER: build/dokka/htmlMultiModule/ | |
TARGET_FOLDER: docs/latest/ | |
CLEAN: true |