Skip to content

Commit

Permalink
ci: improve job steps
Browse files Browse the repository at this point in the history
- remove duplicated jobs
- separate out spotlessCheck (check code format)
  • Loading branch information
WhiredPlanck committed Dec 7, 2023
1 parent 6958b9a commit d42dc7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:

- name: Get branch name
id: vars
shell: bash
run: |
echo ${GITHUB_REF#refs/*/}
echo CI_BRANCH=${GITHUB_REF#refs/*/} >> $GITHUB_ENV
Expand Down Expand Up @@ -52,17 +53,16 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Install Android NDK
run: |
sdkmanager --install "cmake;3.22.1"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Check code format
run: |
./gradlew spotlessCheck
# `make debug` works not well on Windows
- name: Build Debug APK
run: |
./gradlew spotlessCheck
./gradlew :app:assembleDebug
- name: Add JNI cache
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:

- name: Get branch name
id: vars
shell: bash
run: |
echo ${GITHUB_REF#refs/*/}
echo CI_BRANCH=${GITHUB_REF#refs/*/} >> $GITHUB_ENV
Expand All @@ -37,7 +38,7 @@ jobs:
run: script/cache-hash.sh

- name: Fetch JNI cache
uses: actions/cache@v2
uses: actions/cache@v3
id: jni-cache
with:
path: "app/prebuilt"
Expand All @@ -59,17 +60,16 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Install Android NDK
run: |
sdkmanager --install "cmake;3.22.1"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Check code format
run: |
./gradlew spotlessCheck
# `make debug` works not well on Windows
- name: Build Debug APK
run: |
./gradlew spotlessCheck
./gradlew :app:assembleDebug
- name: Add JNI cache
Expand Down

0 comments on commit d42dc7c

Please sign in to comment.