Skip to content

Commit

Permalink
ci: build on Ubunt, macOS and Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Dec 4, 2023
1 parent b2a8552 commit 3af44f3
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 20 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
name: commit ci
name: Commit
on: [push]

env:
CI_NAME: Commit CI
jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-22.04
- macos-13
- windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch source code
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -44,25 +51,31 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Install dependency
run: ./script/dependency.sh
- name: Install Android NDK
run: |
sdkmanager --install "cmake;3.22.1"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build Trime
run: make debug
- name: Build Debug APK
run: |
./gradlew spotlessCheck
./gradlew :app:assembleDebug
- name: Add JNI cache
if: ${{ !steps.jni-cache.outputs.cache-hit }}
run: cp -R app/build/intermediates/stripped_native_libs/debug/out/lib app/prebuilt

- name: Upload Trime artifact
- name: Upload APK artifact
uses: actions/upload-artifact@v3
with:
name: trime
path: app/build/outputs/apk/**/*.apk
# keep 90 days
retention-days: 90

- name: Upload Trime artifact (ARM64_V8A only)
- name: Upload APK artifact (ARM64_V8A only)
uses: actions/upload-artifact@v3
with:
name: trime_arm64_v8a
Expand Down
40 changes: 30 additions & 10 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
name: pull request ci
on: [pull_request]
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: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-22.04
- macos-13
- windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch source code
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -44,17 +58,23 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Install dependency
run: ./script/dependency.sh
- name: Install Android NDK
run: |
sdkmanager --install "cmake;3.22.1"
- name: Build Trime
run: make debug
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build Debug APK
run: |
./gradlew spotlessCheck
./gradlew :app:assembleDebug
- name: Add JNI cache
if: ${{ !steps.jni-cache.outputs.cache-hit }}
run: cp -R app/build/intermediates/stripped_native_libs/debug/out/lib app/prebuilt

- name: Upload Trime artifact
- name: Upload APK artifact
uses: actions/upload-artifact@v3
with:
name: trime.zip
Expand Down

0 comments on commit 3af44f3

Please sign in to comment.