From 3473430a84fe51c12d9ba964cd00391d1d41c380 Mon Sep 17 00:00:00 2001 From: NextAlone <12210746+NextAlone@users.noreply.github.com> Date: Fri, 13 May 2022 23:04:51 +0800 Subject: [PATCH] ci: add pr check --- .github/workflows/pr_ci.yml | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/pr_ci.yml diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml new file mode 100644 index 0000000..570a68b --- /dev/null +++ b/.github/workflows/pr_ci.yml @@ -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