diff --git a/.github/workflows/commit_ci.yml b/.github/workflows/commit_ci.yml new file mode 100644 index 0000000..b099a0f --- /dev/null +++ b/.github/workflows/commit_ci.yml @@ -0,0 +1,63 @@ +name: Automatic Build on Commit + +on: + workflow_dispatch: + push: + branches: [ master ] + paths-ignore: + - '**.md' + - '**.txt' + - '.github/**' + - '!.github/workflows/**' + +jobs: + build: + name: Build CI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1 + with: + cmake-version: '3.22.1' + - name: Prepare Java 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + java-package: jdk + distribution: 'temurin' + cache: 'gradle' + - name: Cache Gradle Dependencies + uses: actions/cache@v3 + 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@v3 + with: + path: | + ~/.gradle/caches/build-cache-* + key: gradle-builds-core-${{ github.sha }} + restore-keys: | + gradle-builds + - name: Build with Gradle + run: | + ./gradlew :app:assembleDebug + ./gradlew :app:assembleRelease + echo "DEBUG_APK_FILE=$(find app/build/outputs/apk/debug -name '*.apk')" >> $GITHUB_ENV + echo "RELEASE_APK_FILE=$(find app/build/outputs/apk/release -name '*.apk')" >> $GITHUB_ENV + - name: Upload Artifacts(debug) + uses: actions/upload-artifact@v3 + with: + path: ${{ env.DEBUG_APK_FILE }} + name: app-debug + - name: Upload Artifacts(release) + uses: actions/upload-artifact@v3 + with: + path: ${{ env.RELEASE_APK_FILE }} + name: app-release diff --git a/.github/workflows/pull_request_ci.yml b/.github/workflows/pull_request_ci.yml new file mode 100644 index 0000000..5675b37 --- /dev/null +++ b/.github/workflows/pull_request_ci.yml @@ -0,0 +1,62 @@ +name: Pull Request Checker + +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@v3 + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1 + with: + cmake-version: '3.22.1' + - name: Prepare Java 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + java-package: jdk + distribution: 'temurin' + cache: 'gradle' + - name: Cache Gradle Dependencies + uses: actions/cache@v3 + 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@v3 + with: + path: | + ~/.gradle/caches/build-cache-* + key: gradle-builds-core-${{ github.sha }} + restore-keys: | + gradle-builds + - name: Build with Gradle + run: | + ./gradlew :app:assembleDebug + ./gradlew :app:assembleRelease + echo "DEBUG_APK_FILE=$(find app/build/outputs/apk/debug -name '*.apk')" >> $GITHUB_ENV + echo "RELEASE_APK_FILE=$(find app/build/outputs/apk/release -name '*.apk')" >> $GITHUB_ENV + - name: Upload Artifacts(debug) + uses: actions/upload-artifact@v3 + with: + path: ${{ env.DEBUG_APK_FILE }} + name: app-debug + - name: Upload Artifacts(release) + uses: actions/upload-artifact@v3 + with: + path: ${{ env.RELEASE_APK_FILE }} + name: app-release