Skip to content

Commit

Permalink
Try out composite actions
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Jan 29, 2024
1 parent 74b7b84 commit e46cdcd
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 39 deletions.
43 changes: 43 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Magisk Setup
runs:
using: "composite"
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"

- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Set up sccache
uses: hendrikmuhs/ccache-action@v1.2
with:
variant: sccache
key: ${{ runner.os }}-${{ github.sha }}
restore-keys: ${{ runner.os }}
max-size: 10000M

- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Cache build cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-build-cache-${{ github.sha }}
restore-keys: ${{ runner.os }}-build-cache-

- name: Set up NDK
run: python build.py -v ndk
40 changes: 1 addition & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,45 +32,7 @@ jobs:
submodules: "recursive"
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"

- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Set up sccache
uses: hendrikmuhs/ccache-action@v1.2
with:
variant: sccache
key: ${{ runner.os }}-${{ github.sha }}
restore-keys: ${{ runner.os }}
max-size: 10000M

- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Cache build cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-build-cache-${{ github.sha }}
restore-keys: ${{ runner.os }}-build-cache-

- name: Set up NDK
run: python build.py -v ndk
- uses: ./.github/actions/setup

- name: Build release
run: |
Expand Down

0 comments on commit e46cdcd

Please sign in to comment.