Skip to content

Commit

Permalink
Prepare pipeline for trunk base (#4)
Browse files Browse the repository at this point in the history
* Prepare pipeline for trunk base

* Fix wrong action name

* Fix wrong action name

* Fix wrong action name

---------

Co-authored-by: Rodrigo M <rodrigo.martins@theboboapp.com>
  • Loading branch information
Rodrigolmti and rodrigo-lm authored Jul 1, 2024
1 parent 32be31e commit 40f4817
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Default

* @rodrigolmti
37 changes: 37 additions & 0 deletions .github/actions/setup-android/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Setup Android Environment"
description: "Setup Android Environment"

runs:
using: "composite"
steps:
- name: "Setup JDK"
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "corretto"
cache: gradle

- name: "Setup Android"
uses: android-actions/setup-android@v3

- name: "Populate Gradle Cache"
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('/*.gradle*', '/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: "Setup Gradle"
uses: gradle/gradle-build-action@v3

with:
add-job-summary-as-pr-comment: 'always'
add-job-summary: 'always'
cache-read-only: false

- name: "Grant execute permission to Gradle wrapper"
run: chmod +x gradlew
shell: bash
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Checklist

- [ ] I have read the [CONTRIBUTING.md];
- [ ] I have added new string and updated all supported languages;
- [ ] I have written unit tests for the changes;

## Description:
<!--- Describe your changes in detail -->

## Test Plan
<!--- Please describe how this change can be tested -->

## Screenshots
<!--- If applicable, add screenshots to help explain your changes -->

<img src="" width="200" />
51 changes: 22 additions & 29 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,27 @@
name: Build develop branch
name: "Pull Request - Validation"

on:
push:
branches:
- develop
workflow_dispatch:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: "Checkout code"
uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17
- name: "Setup Android Environment"
uses: ./.github/actions/setup-android

- name: Generate google-services.json file
- name: "Generate google-services.json file"
run: echo ${{secrets.GOOGLE_SERVICES_KEY}} | base64 -d > app/google-services.json

- name: Grant execute permission to Gradle wrapper
run: chmod +x gradlew

- name: Run unit tests
- name: "Run unit tests"
run: ./gradlew testReleaseUnitTest

- name: Upload test results (XML)
uses: actions/upload-artifact@v4
with:
name: test-results
retention-days: 3
path: '**/build/test-results/test*UnitTest/**.xml'

- name: Report Unit Tests Results
- name: "Report Unit Tests Results"
uses: dorny/test-reporter@v1
if: success()
with:
Expand All @@ -48,19 +34,26 @@ jobs:
fail-on-empty: 'true'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check lint
- name: "Check lint"
run: ./gradlew :app:lintRelease

- name: Upload lint reports (HTML)
- name: "Report lint results"
uses: hidakatsuya/action-report-android-lint@v1.1.3
with:
fail-on-warning: false
result-path: 'app/build/reports/lint-results-release.xml'

- name: "Upload lint reports (HTML)"
if: always()
uses: actions/upload-artifact@v4
with:
name: lint-reports
retention-days: 3
path: '**/build/reports/lint-results-*.html'

- name: Report lint results
uses: hidakatsuya/action-report-android-lint@v1.1.3
- name: "Upload test results (XML)"
uses: actions/upload-artifact@v4
with:
fail-on-warning: false
result-path: 'app/build/reports/lint-results-release.xml'
name: test-results
retention-days: 3
path: '**/build/test-results/test*UnitTest/**.xml'
26 changes: 12 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,38 @@
name: Create and Upload AAB to internal google play track.
name: "Release - Internal Testing"

on:
push:
branches: ["main"]
tags:
- '*.*.*'

jobs:
build:
name: Apk uploading on Firebase App Distribution
name: "Build and Deploy"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: "Checkout code"
uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17
- name: "Setup Android Environment"
uses: ./.github/actions/setup-android

- name: Setup Ruby
- name: "Setup Ruby"
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
bundler-cache: true

- name: Generate google-services.json file
- name: "Generate google-services.json file"
run: echo ${{secrets.GOOGLE_SERVICES_KEY}} | base64 -d > app/google-services.json

- name: Generate service-account.json file
- name: "Generate service-account.json file"
run: echo ${{secrets.SERVICES_ACCOUNT_KEY}} | base64 -d > service-account.json

- name: Generate .jks file
- name: "Generate .jks file"
run: echo ${{secrets.ANDROID_SIGNING_KEY}} | base64 -d > keys/release.jks

- name: Upload AAB to Play Store
- name: "Upload AAB to Play Store"
run: bundle exec fastlane internal
env:
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Deploy static content to Pages
name: "Deploy static content to Pages"

on:
push:
branches: ["main"]
tags:
- '*.*.*'

permissions:
contents: read
Expand All @@ -16,18 +17,18 @@ concurrency:
jobs:
deploy:
environment:
name: github-pages
name: "github-pages"
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: "Checkout code"
uses: actions/checkout@v4
- name: Setup Pages
- name: "Setup Pages"
uses: actions/configure-pages@v4
- name: Upload artifact
- name: "Upload artifact"
uses: actions/upload-pages-artifact@v3
with:
path: './docs'
- name: Deploy to GitHub Pages
path: './legal'
- name: "Deploy to GitHub Pages"
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ To use the app, you will need an API token from Lunch Money. Follow these steps:
## Contributions
As an independent project, contributions, feedback, and suggestions are always welcome. Please reach out or submit pull requests for improvements.

Check out WIKI: [Contributing Guidelines](https://github.com/Rodrigolmti/lunch_money_companion/wiki/Contributing-Guidelines)

## Disclaimer
This application is not officially affiliated with Lunch Money. It is a personal project developed by Rodrigo Lopes Martins, intended to provide an alternative way for Android users to access their Lunch Money data.

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {

defaultConfig {
applicationId = "com.rodrigolmti.lunch.money.companion"
versionCode = 340000001
versionName = "1.6.0"
versionCode = 340000002
versionName = "1.6.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
org.gradle.daemon=true

# Not encouraged by Gradle and can produce weird results. Wait for isolated projects instead.
org.gradle.configureondemand=false
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 40f4817

Please sign in to comment.