Skip to content

Commit 2e70703

Browse files
Merge branch 'vvb2060:master' into master
2 parents e12abb1 + c3db2e3 commit 2e70703

File tree

376 files changed

+20517
-16566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

376 files changed

+20517
-16566
lines changed

.gitattributes

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212

1313
# Denote all files that are truly binary and should not be modified.
1414
tools/** binary
15+
tools/rustup-wrapper/** -binary
16+
tools/elf-cleaner/** -binary
1517
*.jar binary
1618
*.exe binary
1719
*.apk binary
1820
*.png binary
1921
*.jpg binary
2022
*.ttf binary
21-
22-
# Help GitHub detect languages
23-
native/jni/external/** linguist-vendored
24-
native/jni/systemproperties/** linguist-language=C++

.github/actions/setup/action.yml

Lines changed: 78 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,107 @@
11
name: Magisk Setup
2+
inputs:
3+
is-asset-build:
4+
required: false
5+
default: false
26
runs:
37
using: "composite"
48
steps:
5-
- name: Set up JDK 17
9+
- name: Set up JDK 21
610
uses: actions/setup-java@v4
711
with:
812
distribution: "temurin"
9-
java-version: "17"
13+
java-version: "21"
1014

1115
- name: Set up Python 3
1216
uses: actions/setup-python@v5
1317
with:
1418
python-version: "3.x"
1519

16-
- name: Set up sccache
17-
uses: hendrikmuhs/ccache-action@v1.2
18-
with:
19-
variant: sccache
20-
key: ${{ runner.os }}-${{ github.sha }}
21-
restore-keys: ${{ runner.os }}
22-
max-size: 10000M
23-
24-
- name: Set up GNU make
20+
- name: Install GNU make
2521
if: runner.os == 'macOS'
2622
shell: bash
2723
run: |
2824
brew install make
2925
echo 'GNUMAKE=gmake' >> "$GITHUB_ENV"
3026
27+
- name: Cache sccache
28+
uses: actions/cache@v4
29+
if: ${{ github.event_name != 'pull_request' }}
30+
with:
31+
path: .sccache
32+
key: sccache-${{ runner.os }}-${{ github.sha }}
33+
restore-keys: sccache-${{ runner.os }}-
34+
35+
- name: Restore sccache
36+
uses: actions/cache/restore@v4
37+
if: ${{ github.event_name == 'pull_request' }}
38+
with:
39+
path: .sccache
40+
key: sccache-${{ runner.os }}-${{ github.sha }}
41+
restore-keys: sccache-${{ runner.os }}-
42+
43+
- name: Set up sccache
44+
shell: bash
45+
env:
46+
SCCACHE_DIRECT: false
47+
SCCACHE_DIR: ${{ github.workspace }}/.sccache
48+
SCCACHE_CACHE_SIZE: ${{ inputs.is-asset-build == 'true' && '2G' || '300M' }}
49+
SCCACHE_IDLE_TIMEOUT: 0
50+
run: |
51+
bash $GITHUB_ACTION_PATH/sccache.sh
52+
sccache --start-server
53+
sccache -z
54+
55+
- name: Show sccache stats
56+
uses: gacts/run-and-post-run@v1
57+
with:
58+
run: sccache -s
59+
post: sccache -s
60+
61+
- name: Set GRADLE_USER_HOME
62+
shell: bash
63+
run: echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/.gradle" >> "$GITHUB_ENV"
64+
3165
- name: Cache Gradle dependencies
3266
uses: actions/cache@v4
67+
if: ${{ inputs.is-asset-build == 'true' && github.event_name != 'pull_request' }}
3368
with:
3469
path: |
35-
~/.gradle/caches
36-
~/.gradle/wrapper
37-
!~/.gradle/caches/build-cache-*
38-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
39-
restore-keys: ${{ runner.os }}-gradle-
70+
.gradle/caches
71+
.gradle/wrapper
72+
!.gradle/caches/build-cache-*
73+
key: gradle-cache-${{ hashFiles('app/gradle/**') }}
74+
restore-keys: gradle-cache-
4075

41-
- name: Cache build cache
42-
uses: actions/cache@v4
76+
- name: Restore Gradle dependencies
77+
uses: actions/cache/restore@v4
78+
if: ${{ inputs.is-asset-build == 'false' || github.event_name == 'pull_request' }}
4379
with:
4480
path: |
45-
~/.gradle/caches/build-cache-*
46-
key: ${{ runner.os }}-build-cache-${{ github.sha }}
47-
restore-keys: ${{ runner.os }}-build-cache-
81+
.gradle/caches
82+
.gradle/wrapper
83+
!.gradle/caches/build-cache-*
84+
key: gradle-cache-${{ hashFiles('gradle/**') }}
85+
restore-keys: gradle-cache-
86+
enableCrossOsArchive: true
87+
88+
- name: Cache Gradle build cache
89+
uses: actions/cache@v4
90+
if: ${{ inputs.is-asset-build == 'true' && github.event_name != 'pull_request' }}
91+
with:
92+
path: .gradle/caches/build-cache-*
93+
key: gradle-build-cache-${{ github.sha }}
94+
restore-keys: gradle-build-cache-
95+
96+
- name: Restore Gradle build cache
97+
uses: actions/cache/restore@v4
98+
if: ${{ inputs.is-asset-build == 'false' || github.event_name == 'pull_request' }}
99+
with:
100+
path: .gradle/caches/build-cache-*
101+
key: gradle-build-cache-${{ github.sha }}
102+
restore-keys: gradle-build-cache-
103+
enableCrossOsArchive: true
48104

49105
- name: Set up NDK
50-
run: python build.py -v ndk
51106
shell: bash
107+
run: python build.py -v ndk

.github/actions/setup/sccache.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
# Get latest sccache version
4+
get_sccache_ver() {
5+
curl -sL 'https://api.github.com/repos/mozilla/sccache/releases/latest' | jq -r .name
6+
}
7+
8+
# $1=variant
9+
# $2=install_dir
10+
# $3=exe
11+
install_from_gh() {
12+
local ver=$(curl -sL 'https://api.github.com/repos/mozilla/sccache/releases/latest' | jq -r .name)
13+
local url="https://github.com/mozilla/sccache/releases/download/${ver}/sccache-${ver}-$1.tar.gz"
14+
local dest="$2/$3"
15+
curl -L "$url" | tar xz -O --wildcards "*/$3" > $dest
16+
chmod +x $dest
17+
}
18+
19+
if [ $RUNNER_OS = "macOS" ]; then
20+
brew install sccache
21+
elif [ $RUNNER_OS = "Linux" ]; then
22+
install_from_gh x86_64-unknown-linux-musl /usr/local/bin sccache
23+
elif [ $RUNNER_OS = "Windows" ]; then
24+
install_from_gh x86_64-pc-windows-msvc $USERPROFILE/.cargo/bin sccache.exe
25+
fi

.github/workflows/build.yml

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ on:
66
paths:
77
- "app/**"
88
- "native/**"
9-
- "buildSrc/**"
109
- "build.py"
11-
- "gradle.properties"
1210
- ".github/workflows/build.yml"
1311
pull_request:
1412
branches: [master]
@@ -17,20 +15,19 @@ on:
1715
jobs:
1816
build:
1917
name: Build Magisk artifacts
20-
runs-on: macos-14
21-
env:
22-
SCCACHE_DIRECT: false
18+
runs-on: macos-15
2319
strategy:
2420
fail-fast: false
2521
steps:
2622
- name: Check out
2723
uses: actions/checkout@v4
2824
with:
2925
submodules: "recursive"
30-
fetch-depth: 0
3126

3227
- name: Setup environment
3328
uses: ./.github/actions/setup
29+
with:
30+
is-asset-build: true
3431

3532
- name: Build release
3633
run: ./build.py -vr all
@@ -39,7 +36,7 @@ jobs:
3936
run: ./build.py -v all
4037

4138
- name: Stop gradle daemon
42-
run: ./gradlew --stop
39+
run: ./app/gradlew --stop
4340

4441
- name: Upload build artifact
4542
uses: actions/upload-artifact@v4
@@ -58,18 +55,15 @@ jobs:
5855
test-build:
5956
name: Test building on ${{ matrix.os }}
6057
runs-on: ${{ matrix.os }}
61-
env:
62-
SCCACHE_DIRECT: false
6358
strategy:
6459
fail-fast: false
6560
matrix:
66-
os: [windows-latest, ubuntu-latest]
61+
os: [windows-2025, ubuntu-24.04]
6762
steps:
6863
- name: Check out
6964
uses: actions/checkout@v4
7065
with:
7166
submodules: "recursive"
72-
fetch-depth: 0
7367

7468
- name: Setup environment
7569
uses: ./.github/actions/setup
@@ -78,26 +72,25 @@ jobs:
7872
run: python build.py -v -c .github/ci.prop all
7973

8074
- name: Stop gradle daemon
81-
run: ./gradlew --stop
75+
run: ./app/gradlew --stop
8276

8377
avd-test:
8478
name: Test API ${{ matrix.version }} (x86_64)
85-
runs-on: ubuntu-latest
79+
runs-on: ubuntu-24.04
8680
needs: build
81+
if: ${{ github.event_name != 'push' }}
8782
strategy:
8883
fail-fast: false
8984
matrix:
90-
version: [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]
85+
version: [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, "CANARY"]
9186
type: [""]
9287
include:
93-
- version: 35
94-
type: "google_apis"
88+
- version: "CANARY"
89+
type: "google_apis_ps16k"
9590

9691
steps:
9792
- name: Check out
9893
uses: actions/checkout@v4
99-
with:
100-
fetch-depth: 0
10194

10295
- name: Download build artifacts
10396
uses: actions/download-artifact@v4
@@ -112,10 +105,10 @@ jobs:
112105
sudo udevadm trigger --name-match=kvm
113106
114107
- name: Run AVD test
115-
timeout-minutes: 10
108+
timeout-minutes: 15
116109
env:
117110
AVD_TEST_LOG: 1
118-
run: scripts/avd_test.sh ${{ matrix.version }} ${{ matrix.type }}
111+
run: scripts/avd.sh test ${{ matrix.version }} ${{ matrix.type }}
119112

120113
- name: Upload logs on error
121114
if: ${{ failure() }}
@@ -128,8 +121,9 @@ jobs:
128121
129122
avd-test-32:
130123
name: Test API ${{ matrix.version }} (x86)
131-
runs-on: ubuntu-latest
124+
runs-on: ubuntu-24.04
132125
needs: build
126+
if: ${{ github.event_name != 'push' }}
133127
strategy:
134128
fail-fast: false
135129
matrix:
@@ -138,8 +132,6 @@ jobs:
138132
steps:
139133
- name: Check out
140134
uses: actions/checkout@v4
141-
with:
142-
fetch-depth: 0
143135

144136
- name: Download build artifacts
145137
uses: actions/download-artifact@v4
@@ -154,11 +146,11 @@ jobs:
154146
sudo udevadm trigger --name-match=kvm
155147
156148
- name: Run AVD test
157-
timeout-minutes: 10
149+
timeout-minutes: 15
158150
env:
159151
FORCE_32_BIT: 1
160152
AVD_TEST_LOG: 1
161-
run: scripts/avd_test.sh ${{ matrix.version }}
153+
run: scripts/avd.sh test ${{ matrix.version }}
162154

163155
- name: Upload logs on error
164156
if: ${{ failure() }}
@@ -169,24 +161,23 @@ jobs:
169161
kernel.log
170162
logcat.log
171163
172-
cf_test:
173-
name: Test ${{ matrix.branch }} (${{ matrix.target }})
164+
cf-test:
165+
name: Test ${{ matrix.device }}
174166
runs-on: ubuntu-24.04
175167
needs: build
168+
if: ${{ github.event_name != 'push' }}
176169
env:
177170
CF_HOME: /home/runner/aosp_cf_phone
178171
strategy:
179172
fail-fast: false
180173
matrix:
181174
include:
182-
- branch: "aosp-main"
183-
target: "aosp_cf_x86_64_phone-trunk_staging-userdebug"
175+
- branch: "aosp-android-latest-release"
176+
device: "aosp_cf_x86_64_only_phone"
184177

185178
steps:
186179
- name: Check out
187180
uses: actions/checkout@v4
188-
with:
189-
fetch-depth: 0
190181

191182
- name: Download build artifacts
192183
uses: actions/download-artifact@v4
@@ -197,17 +188,17 @@ jobs:
197188
- name: Setup Cuttlefish environment
198189
run: |
199190
scripts/cuttlefish.sh setup
200-
scripts/cuttlefish.sh download ${{ matrix.branch }} ${{ matrix.target }}
191+
scripts/cuttlefish.sh download ${{ matrix.branch }} ${{ matrix.device }}
201192
202193
- name: Run Cuttlefish test
203-
timeout-minutes: 10
204-
run: su $USER -c 'scripts/cuttlefish.sh test'
194+
timeout-minutes: 15
195+
run: sudo -E -u $USER scripts/cuttlefish.sh test
205196

206197
- name: Upload logs on error
207198
if: ${{ failure() }}
208199
uses: actions/upload-artifact@v4
209200
with:
210-
name: "cvd-logs"
201+
name: "cvd-logs-${{ matrix.device }}"
211202
path: |
212203
/home/runner/aosp_cf_phone/cuttlefish/instances/cvd-1/logs
213204
/home/runner/aosp_cf_phone/cuttlefish/instances/cvd-1/cuttlefish_config.json

.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@ out
22
*.zip
33
*.jks
44
*.apk
5+
*.log
56
/config.prop
67
/notes.md
7-
/update.sh
8-
/app/dict.txt
98

109
# Built binaries
1110
native/out
1211

13-
# Android Studio / Gradle
12+
# Android Studio
1413
*.iml
15-
.gradle
1614
.idea
17-
/local.properties
18-
/build
19-
/captures

0 commit comments

Comments
 (0)