mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
ci: add pr check
This commit is contained in:
62
.github/workflows/pr_ci.yml
vendored
Normal file
62
.github/workflows/pr_ci.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
name: main
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- '**.txt'
|
||||||
|
- '.github/**'
|
||||||
|
- '!.github/workflows/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Pull request check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup cmake
|
||||||
|
uses: jwlawson/actions-setup-cmake@v1.12
|
||||||
|
with:
|
||||||
|
cmake-version: '3.22.1'
|
||||||
|
- name: Prepare Java 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
java-package: jdk
|
||||||
|
- name: Cache Gradle Dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
!~/.gradle/caches/build-cache-*
|
||||||
|
key: gradle-deps-core-${{ hashFiles('**/build.gradle') }}
|
||||||
|
restore-keys: |
|
||||||
|
gradle-deps
|
||||||
|
- name: Cache Gradle Build
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches/build-cache-*
|
||||||
|
key: gradle-builds-core-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
gradle-builds
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: |
|
||||||
|
./gradlew :app:assembleRelease
|
||||||
|
./gradlew :demo-app:assembleRelease
|
||||||
|
echo "APK_FILE=$(find app/build/outputs/apk/release -name '*.apk')" >> $GITHUB_ENV
|
||||||
|
echo "DEMO_APK_FILE=$(find demo-app/build/outputs/apk/release -name '*.apk')" >> $GITHUB_ENV
|
||||||
|
- name: Upload Artifacts(module)
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
path: ${{ env.APK_FILE }}
|
||||||
|
name: module-release
|
||||||
|
- name: Upload Artifacts(demo-app)
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
path: ${{ env.DEMO_APK_FILE }}
|
||||||
|
name: demo-release
|
Reference in New Issue
Block a user