Development #61
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🚨 Main WorkFlow | |
| on: | |
| pull_request: | |
| branches: [ "master", "development" ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| JAVA_VERSION: "17" | |
| JAVA_DIST: "temurin" | |
| jobs: | |
| lint: | |
| name: Lint Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: ${{ env.JAVA_DIST }} | |
| java-version: ${{ env.JAVA_VERSION }} | |
| cache: gradle | |
| - name: Decode google-services.json | |
| env: | |
| GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
| run: | | |
| mkdir -p app | |
| printf "%s" "$GOOGLE_SERVICES_JSON" | base64 --decode > app/google-services.json | |
| - name: Grant gradlew permission | |
| run: chmod +x ./gradlew | |
| - name: Run lint | |
| run: ./gradlew lintFossDebug | |
| - name: Upload lint report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-report | |
| path: app/build/reports/lint-results-*.html | |
| unit-test: | |
| name: Unit Tests | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: ${{ env.JAVA_DIST }} | |
| java-version: ${{ env.JAVA_VERSION }} | |
| cache: gradle | |
| - name: Decode google-services.json | |
| env: | |
| GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
| run: | | |
| mkdir -p app | |
| printf "%s" "$GOOGLE_SERVICES_JSON" | base64 --decode > app/google-services.json | |
| - name: Grant gradlew permission | |
| run: chmod +x ./gradlew | |
| - name: Run unit tests | |
| run: ./gradlew test | |
| - name: Upload test report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unit-test-report | |
| path: app/build/reports/tests/testDebugUnitTest/ | |
| distribution: | |
| name: Build Debug APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: ${{ env.JAVA_DIST }} | |
| java-version: ${{ env.JAVA_VERSION }} | |
| cache: gradle | |
| - name: Decode google-services.json | |
| env: | |
| GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
| run: | | |
| mkdir -p app | |
| printf "%s" "$GOOGLE_SERVICES_JSON" | base64 --decode > app/google-services.json | |
| - name: Grant gradlew permission | |
| run: chmod +x ./gradlew | |
| - name: Build debug APK | |
| run: ./gradlew assembleDebug --stacktrace | |
| - name: Upload debug APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: debug-apk | |
| path: app/build/outputs/apk/debug/app-debug.apk | |