Skip to content

Commit

Permalink
Separate Linux and other jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Jan 29, 2024
1 parent 8e7186e commit df786eb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ runs:
max-size: 10000M

- name: Cache Gradle dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -32,7 +32,7 @@ runs:
restore-keys: ${{ runner.os }}-gradle-

- name: Cache build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches/build-cache-*
Expand Down
43 changes: 31 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,70 @@ on:

jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: Build Magisk artifacts
runs-on: ubuntu-latest
env:
SCCACHE_DIRECT: false
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
steps:
- name: Check out
uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0

- uses: ./.github/actions/setup
- name: Setup environment
uses: ./.github/actions/setup

- name: Build release
run: |
python build.py -vr all
run: ./build.py -vr all

- name: Build debug
run: |
python build.py -v all
run: ./build.py -v all

- name: Stop gradle daemon
run: ./gradlew --stop

# Only upload artifacts built on Linux
- name: Upload build artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
path: out
compression-level: 9

- name: Upload mapping and native debug symbols
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-symbols
path: app/build/outputs
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:
name: Test on API ${{ matrix.api }}
runs-on: ubuntu-latest
Expand Down

0 comments on commit df786eb

Please sign in to comment.