From e46cdcd33b8ceadce0b61b677df419f24e49b457 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 29 Jan 2024 01:34:46 -0800 Subject: [PATCH] Try out composite actions --- .github/actions/setup/action.yml | 43 ++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 40 +---------------------------- 2 files changed, 44 insertions(+), 39 deletions(-) create mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000000000..4ea14cab4d84e --- /dev/null +++ b/.github/actions/setup/action.yml @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3341d4b653c4d..d3e1f68da4127 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: |