2020-12-25 23:01:02 +00:00
|
|
|
name: Magisk Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-05-10 07:10:19 +00:00
|
|
|
branches: [master]
|
2020-12-29 00:38:25 +00:00
|
|
|
paths:
|
2023-05-10 07:10:19 +00:00
|
|
|
- "app/**"
|
|
|
|
- "native/**"
|
|
|
|
- "stub/**"
|
|
|
|
- "buildSrc/**"
|
|
|
|
- "build.py"
|
|
|
|
- "gradle.properties"
|
|
|
|
- ".github/workflows/build.yml"
|
2020-12-25 23:01:02 +00:00
|
|
|
pull_request:
|
2023-05-10 07:10:19 +00:00
|
|
|
branches: [master]
|
2020-12-25 23:01:02 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build on ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-10-24 23:45:24 +00:00
|
|
|
os: [ubuntu-latest, windows-latest, macos-13]
|
2020-12-25 23:01:02 +00:00
|
|
|
steps:
|
|
|
|
- name: Check out
|
2023-10-26 21:50:42 +00:00
|
|
|
uses: actions/checkout@v4
|
2020-12-25 23:01:02 +00:00
|
|
|
with:
|
2023-05-10 07:10:19 +00:00
|
|
|
submodules: "recursive"
|
2020-12-25 23:01:02 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
|
2022-10-18 15:05:16 +00:00
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v3
|
2020-12-25 23:01:02 +00:00
|
|
|
with:
|
2023-05-10 07:10:19 +00:00
|
|
|
distribution: "temurin"
|
|
|
|
java-version: "17"
|
2020-12-25 23:01:02 +00:00
|
|
|
|
|
|
|
- name: Set up Python 3
|
2022-10-18 15:05:16 +00:00
|
|
|
uses: actions/setup-python@v4
|
2020-12-25 23:01:02 +00:00
|
|
|
with:
|
2023-05-10 07:10:19 +00:00
|
|
|
python-version: "3.x"
|
2020-12-25 23:01:02 +00:00
|
|
|
|
2022-09-22 02:10:47 +00:00
|
|
|
- name: Set up sccache
|
2023-06-10 20:17:16 +00:00
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
variant: sccache
|
|
|
|
key: ${{ runner.os }}-${{ github.sha }}
|
|
|
|
restore-keys: ${{ runner.os }}
|
|
|
|
max-size: 10000M
|
2020-12-25 23:01:02 +00:00
|
|
|
|
2021-09-08 08:16:26 +00:00
|
|
|
- name: Cache Gradle dependencies
|
2022-10-18 15:05:16 +00:00
|
|
|
uses: actions/cache@v3
|
2020-12-25 23:01:02 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
2021-09-08 08:16:26 +00:00
|
|
|
!~/.gradle/caches/build-cache-*
|
2020-12-25 23:01:02 +00:00
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gradle-
|
|
|
|
|
2021-09-08 08:16:26 +00:00
|
|
|
- name: Cache build cache
|
2022-10-18 15:05:16 +00:00
|
|
|
uses: actions/cache@v3
|
2021-09-08 05:50:47 +00:00
|
|
|
with:
|
2021-09-08 08:16:26 +00:00
|
|
|
path: |
|
|
|
|
~/.gradle/caches/build-cache-*
|
|
|
|
key: ${{ runner.os }}-build-cache-${{ github.sha }}
|
|
|
|
restore-keys: ${{ runner.os }}-build-cache-
|
2021-09-08 05:50:47 +00:00
|
|
|
|
2020-12-25 23:01:02 +00:00
|
|
|
- name: Set up NDK
|
2021-09-08 08:16:26 +00:00
|
|
|
run: python build.py -v ndk
|
2020-12-25 23:01:02 +00:00
|
|
|
|
|
|
|
- name: Build release
|
2021-09-08 05:50:47 +00:00
|
|
|
run: |
|
|
|
|
python build.py -vr all
|
2020-12-25 23:01:02 +00:00
|
|
|
|
|
|
|
- name: Build debug
|
2021-09-08 05:50:47 +00:00
|
|
|
run: |
|
|
|
|
python build.py -v all
|
2020-12-25 23:01:02 +00:00
|
|
|
|
2022-09-14 14:59:12 +00:00
|
|
|
- name: Stop gradle daemon
|
|
|
|
run: ./gradlew --stop
|
|
|
|
|
2020-12-25 23:01:02 +00:00
|
|
|
# Only upload artifacts built on Linux
|
|
|
|
- name: Upload build artifact
|
2020-12-27 12:02:20 +00:00
|
|
|
if: runner.os == 'Linux'
|
2022-10-18 15:05:16 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-12-25 23:01:02 +00:00
|
|
|
with:
|
2020-12-25 23:54:47 +00:00
|
|
|
name: ${{ github.sha }}
|
2020-12-25 23:01:02 +00:00
|
|
|
path: out
|
2022-09-14 14:59:12 +00:00
|
|
|
|
|
|
|
- name: Upload mapping and native debug symbols
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ github.sha }}-symbols
|
|
|
|
path: app/build/outputs
|
2023-04-24 20:54:46 +00:00
|
|
|
|
2023-05-10 07:10:19 +00:00
|
|
|
test:
|
|
|
|
name: Test on ${{ matrix.api }}
|
2023-10-24 23:45:24 +00:00
|
|
|
runs-on: macos-13
|
2023-05-10 07:10:19 +00:00
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-11-26 13:41:43 +00:00
|
|
|
api: [23, 26, 28, 33, 34]
|
2023-05-10 07:10:19 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out
|
2023-11-13 11:11:24 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-05-10 07:10:19 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Python 3
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
|
|
|
|
|
|
|
- name: Download build artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ github.sha }}
|
|
|
|
path: out
|
|
|
|
|
2023-04-24 20:54:46 +00:00
|
|
|
- name: AVD test
|
|
|
|
run: |
|
2023-10-12 07:45:53 +00:00
|
|
|
brew install coreutils bash
|
2023-05-10 07:10:19 +00:00
|
|
|
scripts/avd_test.sh ${{ matrix.api }}
|