Skip to content

Commit 8e7186e

Browse files
author
topjohnwu
committed
Try out composite actions
1 parent 74b7b84 commit 8e7186e

2 files changed

Lines changed: 45 additions & 39 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Magisk Setup
2+
runs:
3+
using: "composite"
4+
steps:
5+
- name: Set up JDK 17
6+
uses: actions/setup-java@v4
7+
with:
8+
distribution: "temurin"
9+
java-version: "17"
10+
11+
- name: Set up Python 3
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.x"
15+
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: Cache Gradle dependencies
25+
uses: actions/cache@v3
26+
with:
27+
path: |
28+
~/.gradle/caches
29+
~/.gradle/wrapper
30+
!~/.gradle/caches/build-cache-*
31+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
32+
restore-keys: ${{ runner.os }}-gradle-
33+
34+
- name: Cache build cache
35+
uses: actions/cache@v3
36+
with:
37+
path: |
38+
~/.gradle/caches/build-cache-*
39+
key: ${{ runner.os }}-build-cache-${{ github.sha }}
40+
restore-keys: ${{ runner.os }}-build-cache-
41+
42+
- name: Set up NDK
43+
run: python build.py -v ndk
44+
shell: bash

.github/workflows/build.yml

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,7 @@ jobs:
3232
submodules: "recursive"
3333
fetch-depth: 0
3434

35-
- name: Set up JDK 17
36-
uses: actions/setup-java@v4
37-
with:
38-
distribution: "temurin"
39-
java-version: "17"
40-
41-
- name: Set up Python 3
42-
uses: actions/setup-python@v4
43-
with:
44-
python-version: "3.x"
45-
46-
- name: Set up sccache
47-
uses: hendrikmuhs/ccache-action@v1.2
48-
with:
49-
variant: sccache
50-
key: ${{ runner.os }}-${{ github.sha }}
51-
restore-keys: ${{ runner.os }}
52-
max-size: 10000M
53-
54-
- name: Cache Gradle dependencies
55-
uses: actions/cache@v3
56-
with:
57-
path: |
58-
~/.gradle/caches
59-
~/.gradle/wrapper
60-
!~/.gradle/caches/build-cache-*
61-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
62-
restore-keys: ${{ runner.os }}-gradle-
63-
64-
- name: Cache build cache
65-
uses: actions/cache@v3
66-
with:
67-
path: |
68-
~/.gradle/caches/build-cache-*
69-
key: ${{ runner.os }}-build-cache-${{ github.sha }}
70-
restore-keys: ${{ runner.os }}-build-cache-
71-
72-
- name: Set up NDK
73-
run: python build.py -v ndk
35+
- uses: ./.github/actions/setup
7436

7537
- name: Build release
7638
run: |

0 commit comments

Comments
 (0)