Separate Linux and other jobs

This commit is contained in:
topjohnwu 2024-01-29 01:53:09 -08:00
parent 8e7186eebb
commit df786eb2b6
2 changed files with 33 additions and 14 deletions

View File

@ -22,7 +22,7 @@ runs:
max-size: 10000M max-size: 10000M
- name: Cache Gradle dependencies - name: Cache Gradle dependencies
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: | path: |
~/.gradle/caches ~/.gradle/caches
@ -32,7 +32,7 @@ runs:
restore-keys: ${{ runner.os }}-gradle- restore-keys: ${{ runner.os }}-gradle-
- name: Cache build cache - name: Cache build cache
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: | path: |
~/.gradle/caches/build-cache-* ~/.gradle/caches/build-cache-*

View File

@ -17,14 +17,12 @@ on:
jobs: jobs:
build: build:
name: Build on ${{ matrix.os }} name: Build Magisk artifacts
runs-on: ${{ matrix.os }} runs-on: ubuntu-latest
env: env:
SCCACHE_DIRECT: false SCCACHE_DIRECT: false
strategy: strategy:
fail-fast: false fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
steps: steps:
- name: Check out - name: Check out
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -32,22 +30,19 @@ jobs:
submodules: "recursive" submodules: "recursive"
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/setup - name: Setup environment
uses: ./.github/actions/setup
- name: Build release - name: Build release
run: | run: ./build.py -vr all
python build.py -vr all
- name: Build debug - name: Build debug
run: | run: ./build.py -v all
python build.py -v all
- name: Stop gradle daemon - name: Stop gradle daemon
run: ./gradlew --stop run: ./gradlew --stop
# Only upload artifacts built on Linux
- name: Upload build artifact - name: Upload build artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ github.sha }} name: ${{ github.sha }}
@ -55,13 +50,37 @@ jobs:
compression-level: 9 compression-level: 9
- name: Upload mapping and native debug symbols - name: Upload mapping and native debug symbols
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ github.sha }}-symbols name: ${{ github.sha }}-symbols
path: app/build/outputs path: app/build/outputs
compression-level: 9 compression-level: 9
test-build:
name: Test building on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
SCCACHE_DIRECT: false
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-13]
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
test: test:
name: Test on API ${{ matrix.api }} name: Test on API ${{ matrix.api }}
runs-on: ubuntu-latest runs-on: ubuntu-latest