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/**"
|
|
|
|
- "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:
|
2024-01-29 09:53:09 +00:00
|
|
|
name: Build Magisk artifacts
|
|
|
|
runs-on: ubuntu-latest
|
2023-11-29 17:55:27 +00:00
|
|
|
env:
|
|
|
|
SCCACHE_DIRECT: false
|
2020-12-25 23:01:02 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
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
|
|
|
|
|
2024-01-29 09:53:09 +00:00
|
|
|
- name: Setup environment
|
|
|
|
uses: ./.github/actions/setup
|
2020-12-25 23:01:02 +00:00
|
|
|
|
|
|
|
- name: Build release
|
2024-01-29 09:53:09 +00:00
|
|
|
run: ./build.py -vr all
|
2020-12-25 23:01:02 +00:00
|
|
|
|
|
|
|
- name: Build debug
|
2024-01-29 09:53:09 +00:00
|
|
|
run: ./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
|
|
|
- name: Upload build artifact
|
2023-12-17 09:57:39 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
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
|
2023-12-17 09:57:39 +00:00
|
|
|
compression-level: 9
|
2022-09-14 14:59:12 +00:00
|
|
|
|
|
|
|
- name: Upload mapping and native debug symbols
|
2023-12-17 09:57:39 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-09-14 14:59:12 +00:00
|
|
|
with:
|
|
|
|
name: ${{ github.sha }}-symbols
|
2024-07-07 15:06:39 +00:00
|
|
|
path: app/apk/build/outputs
|
2023-12-17 09:57:39 +00:00
|
|
|
compression-level: 9
|
2023-04-24 20:54:46 +00:00
|
|
|
|
2024-01-29 09:53:09 +00:00
|
|
|
test-build:
|
|
|
|
name: Test building on ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
env:
|
|
|
|
SCCACHE_DIRECT: false
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-01-31 22:54:42 +00:00
|
|
|
os: [windows-latest, macos-14]
|
2024-01-29 09:53:09 +00:00
|
|
|
steps:
|
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: "recursive"
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup environment
|
|
|
|
uses: ./.github/actions/setup
|
|
|
|
|
|
|
|
- name: Build debug
|
|
|
|
run: python build.py -v all
|
|
|
|
|
|
|
|
- name: Stop gradle daemon
|
|
|
|
run: ./gradlew --stop
|
|
|
|
|
2024-07-20 10:10:18 +00:00
|
|
|
avd-test:
|
2024-06-21 01:28:58 +00:00
|
|
|
name: Test x86_64 on API ${{ matrix.version }}
|
2024-01-23 02:10:26 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-05-10 07:10:19 +00:00
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-06-21 01:28:58 +00:00
|
|
|
version: [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]
|
|
|
|
type: [""]
|
|
|
|
include:
|
|
|
|
- version: 35
|
|
|
|
type: "google_apis"
|
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
|
2024-01-28 08:46:03 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-05-10 07:10:19 +00:00
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
|
|
|
|
|
|
|
- name: Download build artifacts
|
2023-12-17 09:57:39 +00:00
|
|
|
uses: actions/download-artifact@v4
|
2023-05-10 07:10:19 +00:00
|
|
|
with:
|
|
|
|
name: ${{ github.sha }}
|
|
|
|
path: out
|
|
|
|
|
2024-01-23 02:10:26 +00:00
|
|
|
- name: Enable KVM group perms
|
2023-04-24 20:54:46 +00:00
|
|
|
run: |
|
2024-01-23 02:10:26 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
- name: AVD test
|
2024-07-12 18:39:11 +00:00
|
|
|
timeout-minutes: 10
|
2024-06-21 09:45:48 +00:00
|
|
|
env:
|
|
|
|
AVD_TEST_VERBOSE: 1
|
2024-06-21 01:28:58 +00:00
|
|
|
run: scripts/avd_test.sh ${{ matrix.version }} ${{ matrix.type }}
|
2024-04-10 09:56:23 +00:00
|
|
|
|
2024-07-20 10:10:18 +00:00
|
|
|
avd-test-32:
|
2024-06-21 01:28:58 +00:00
|
|
|
name: Test x86 on API ${{ matrix.version }}
|
2024-04-10 09:56:23 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-06-21 01:28:58 +00:00
|
|
|
version: [23, 24, 25, 26, 27, 28, 29, 30]
|
2024-04-10 09:56:23 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Python 3
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
|
|
|
|
|
|
|
- name: Download build artifacts
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
name: ${{ github.sha }}
|
|
|
|
path: out
|
|
|
|
|
|
|
|
- name: Enable KVM group perms
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: AVD test
|
2024-07-12 18:39:11 +00:00
|
|
|
timeout-minutes: 10
|
2024-04-10 09:56:23 +00:00
|
|
|
env:
|
|
|
|
FORCE_32_BIT: 1
|
2024-06-21 09:45:48 +00:00
|
|
|
AVD_TEST_VERBOSE: 1
|
2024-06-21 01:28:58 +00:00
|
|
|
run: scripts/avd_test.sh ${{ matrix.version }}
|
2024-07-20 10:10:18 +00:00
|
|
|
|
|
|
|
cf_test:
|
|
|
|
name: Test on AOSP main Cuttlefish
|
|
|
|
runs-on: ubuntu-24.04
|
|
|
|
env:
|
|
|
|
CF_HOME: /home/runner/aosp_cf_x86_64_phone
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup Cuttlefish environment
|
|
|
|
run: |
|
|
|
|
scripts/cuttlefish.sh setup
|
|
|
|
scripts/cuttlefish.sh download
|
|
|
|
|
|
|
|
- name: Wait for build artifacts
|
|
|
|
uses: lewagon/wait-on-check-action@v1.3.4
|
|
|
|
timeout-minutes: 45
|
|
|
|
with:
|
|
|
|
ref: ${{ github.ref }}
|
|
|
|
check-name: 'Build Magisk artifacts'
|
|
|
|
|
|
|
|
- name: Download build artifacts
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
name: ${{ github.sha }}
|
|
|
|
path: out
|
|
|
|
|
|
|
|
- name: Run Cuttlefish test
|
|
|
|
run: su $USER -c 'scripts/cuttlefish.sh test'
|
|
|
|
|
|
|
|
- name: Upload logs on error
|
|
|
|
if: ${{ failure() }}
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: "cvd-logs"
|
|
|
|
path: |
|
|
|
|
/home/runner/aosp_cf_x86_64_phone/cuttlefish/instances/cvd-1/logs
|
|
|
|
/home/runner/aosp_cf_x86_64_phone/cuttlefish/instances/cvd-1/cuttlefish_config.json
|