fix(deps): update all dependencies #365
This file contains 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: TFC | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
TZ: America/Sao_Paulo | |
jobs: | |
cancel-stale-jobs: | |
name: Cancel stale jobs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Stale Jobs | |
uses: styfle/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
validation: | |
name: Validation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v3 | |
assemble: | |
name: Assembling | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Common Steps | |
uses: ./.github/actions/common-steps | |
- name: Create and populate google-services file | |
env: | |
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} | |
run: | | |
touch app/google-services.json | |
echo $GOOGLE_SERVICES >> app/google-services.json | |
- name: Assemble TFC | |
run: ./gradlew assembleDebug --no-daemon --scan | |
- name: Upload compose reports artifact | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: compose-reports | |
path: | | |
**/build/compose-metrics | |
**/build/compose-reports | |
retention-days: 7 | |
static-analysis: | |
name: Static analysis | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
security-events: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Common Steps | |
uses: ./.github/actions/common-steps | |
- name: Create and populate google-services file | |
env: | |
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} | |
run: | | |
touch app/google-services.json | |
echo $GOOGLE_SERVICES >> app/google-services.json | |
- name: Run detekt | |
run: ./gradlew detektAll lintDebug --no-daemon | |
- name: Upload static reports artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: static-report | |
path: | | |
build/reports/detekt/detekt.xml | |
**/build/reports/lint-results-debug.xml | |
retention-days: 1 | |
- name: Analyze detekt report | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: build/reports/detekt/detekt.sarif | |
checkout_path: ${{ github.workspace }} | |
unit-tests: | |
name: Unit testing | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Common Steps | |
uses: ./.github/actions/common-steps | |
- name: Create and populate google-services file | |
env: | |
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} | |
run: | | |
touch app/google-services.json | |
echo $GOOGLE_SERVICES >> app/google-services.json | |
- name: Run unit tests | |
run: ./gradlew unitTests koverXmlReport koverMergedReport koverMergedVerify --no-daemon --scan | |
- name: Upload tests reports artifact (success) | |
uses: actions/upload-artifact@v4 | |
if: success() | |
with: | |
name: tests-reports | |
path: build/reports/allTests | |
retention-days: 7 | |
- name: Upload tests reports artifact (failure) | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: tests-reports | |
path: | | |
**/build/reports/tests/test | |
**/build/reports/tests/testDebugUnitTest | |
retention-days: 7 | |
- name: Upload coverage reports artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-reports | |
path: '**/build/reports/kover/xml/report.xml' | |
retention-days: 1 | |
- name: Upload report to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: build/reports/kover/merged/xml/report.xml | |
flags: unittests | |
verbose: true | |
sonar: | |
name: SonarQube | |
runs-on: ubuntu-latest | |
needs: [ static-analysis, unit-tests ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Common Steps | |
uses: ./.github/actions/common-steps | |
- name: Create and populate google-services file | |
env: | |
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} | |
run: | | |
touch app/google-services.json | |
echo $GOOGLE_SERVICES >> app/google-services.json | |
- name: Download static report artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: static-report | |
path: . | |
- name: Download coverage artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage-reports | |
path: . | |
- name: Run SonarQube | |
if: github.event_name != 'pull_request' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew sonar --no-daemon | |
- name: Run SonarQube in PR | |
if: github.event_name == 'pull_request' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew sonar -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} --no-daemon | |
deploy-beta: | |
name: Beta deployment | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: [ assemble, static-analysis, unit-tests ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Common Steps | |
uses: ./.github/actions/common-steps | |
- name: Create and populate google-services file | |
env: | |
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} | |
run: | | |
touch app/google-services.json | |
echo $GOOGLE_SERVICES >> app/google-services.json | |
- name: Build staging APK | |
run: ./gradlew assembleDebug --no-daemon --scan | |
- name: Upload artifact to Firebase App Distribution | |
uses: wzieba/Firebase-Distribution-Github-Action@v1 | |
with: | |
appId: ${{secrets.FIREBASE_APP_ID}} | |
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | |
file: app/build/outputs/apk/debug/app-debug.apk | |
groups: devs | |
deploy-production: | |
name: Production deployment | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [ assemble, static-analysis, unit-tests ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Common Steps | |
uses: ./.github/actions/common-steps | |
- name: Decode keystore | |
uses: timheuer/[email protected] | |
with: | |
fileDir: . | |
fileName: ${{ secrets.SIGNING_FILE }} | |
encodedString: ${{ secrets.SIGNING_FILE_BASE64 }} | |
- name: Build production AAB | |
env: | |
SIGNING_ALIAS: ${{ secrets.SIGNING_ALIAS }} | |
SIGNING_ALIAS_PASS: ${{ secrets.SIGNING_ALIAS_PASS }} | |
SIGNING_FILE: ${{ secrets.SIGNING_FILE }} | |
SIGNING_FILE_PASS: ${{ secrets.SIGNING_FILE_PASS }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROD_PROJECT }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: ./gradlew assembleRelease bundleRelease --no-daemon --scan | |
- name: Publish production AAB to Google Play | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }} | |
packageName: dev.alvr.katana | |
releaseFiles: app/build/outputs/bundle/release/app-release.aab | |
track: internal | |
status: completed | |
mappingFile: app/build/outputs/mapping/release/mapping.txt | |
- name: Create Sentry release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROD_PROJECT }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
with: | |
environment: production | |
version: ${{ github.ref }} | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
name: Katana ${{ github.ref_name }} | |
files: | | |
app/build/outputs/apk/release/app-release.apk | |
draft: true | |
prerelease: false |