Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release sync #57

Merged
merged 45 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a6a2a6a
Add e2e testing workflow
shounak-mulay Aug 26, 2023
a35c7ca
Use qa env file in e2e workflow
shounak-mulay Aug 26, 2023
2f9cf45
Merge branch 'main' into e2e-workflow
shounak-mulay Aug 26, 2023
683c2f8
Merge pull request #46 from wednesday-solutions/e2e-workflow
shounak-mulay Aug 26, 2023
e64c0fb
Update e2e.yml
shounak-mulay Aug 26, 2023
373e076
Add verbose patrol logs
shounak-mulay Aug 26, 2023
d1b1716
Add verbose patrol logs
shounak-mulay Aug 26, 2023
85fd137
Generate config before test apk
shounak-mulay Aug 26, 2023
599e27f
test rules
shounak-mulay Aug 27, 2023
17ce5b3
revert policy check
shounak-mulay Aug 27, 2023
e7ca08e
Merge pull request #48 from wednesday-solutions/e2e-workflow-test
shounak-mulay Aug 27, 2023
fe19b71
Wait for home to update in favourite test
shounak-mulay Aug 29, 2023
ada3102
Merge branch 'main' of github.com-wednesday:wednesday-solutions/flutt…
shounak-mulay Aug 29, 2023
3fead7f
fix: workflow fix for fork PRs
anasnadeemws Mar 15, 2024
915e420
Merge pull request #49 from anasnadeemws/fix/fork-workflow-issue
alichherawalla Mar 20, 2024
1c09e76
Upgrade packages. Update android gradle files to match new gradle syntax
shounak-mulay Apr 8, 2024
57a1bcc
Update target and compile sdk version to 34
shounak-mulay Apr 8, 2024
a16aabc
Add script for e2e
shounak-mulay Apr 8, 2024
3f5c3cd
Update workflows
shounak-mulay Apr 8, 2024
5ca1525
Convert result class to dart sealed class
shounak-mulay Apr 8, 2024
dd4bb24
Make result class equatable
shounak-mulay Apr 8, 2024
c80f63e
Merge branch 'main' into lib_version_upgrades
shounak-mulay Apr 8, 2024
4edf3c6
Add cache key to flutter action
shounak-mulay Apr 8, 2024
504f398
Change cache key for flutter action to force refresh
shounak-mulay Apr 8, 2024
a312799
Change pub cache key for flutter action to force refresh
shounak-mulay Apr 8, 2024
280b12a
Update README.md
shounak-mulay Apr 8, 2024
23e6089
Merge pull request #52 from wednesday-solutions/readme-patrol-update
shounak-mulay Apr 8, 2024
e65ba6e
Merge branch 'main' into lib_version_upgrades
shounak-mulay Apr 8, 2024
4d4d6a6
Change pub cache key for flutter action to force refresh
shounak-mulay Apr 8, 2024
3d34264
Merge pull request #53 from wednesday-solutions/cache-key-update
shounak-mulay Apr 9, 2024
8b2ea87
Change pub cache key for flutter action to force refresh
shounak-mulay Apr 9, 2024
fc08270
Merge pull request #54 from wednesday-solutions/cache-key-update
shounak-mulay Apr 9, 2024
a2102cb
Merge branch 'main' into lib_version_upgrades
shounak-mulay Apr 9, 2024
381ff89
Change pub cache key for flutter action to force refresh
shounak-mulay Apr 9, 2024
a676207
Merge pull request #55 from wednesday-solutions/cache-key-update
shounak-mulay Apr 9, 2024
df7e0ef
Merge branch 'main' into lib_version_upgrades
shounak-mulay Apr 9, 2024
e7c1780
Update ci.yml
shounak-mulay Apr 9, 2024
767f171
Update e2e.yml
shounak-mulay Apr 9, 2024
d252b16
Merge pull request #56 from wednesday-solutions/shounak-mulay-patch-1
shounak-mulay Apr 9, 2024
d08db9d
Merge branch 'main' into lib_version_upgrades
shounak-mulay Apr 9, 2024
ad02e58
Use super values in constructors
shounak-mulay Apr 9, 2024
a2acdbf
Merge branch 'lib_version_upgrades' of github.com-wednesday:wednesday…
shounak-mulay Apr 9, 2024
eb4459f
Setup java 17 in android jobs
shounak-mulay Apr 9, 2024
2de0433
Update goldens
shounak-mulay Apr 9, 2024
3d08aad
Merge pull request #51 from wednesday-solutions/lib_version_upgrades
shounak-mulay Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env.dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
OPEN_WEATHER_API_KEY=YOUR_API_KEY
OPEN_WEATHER_BASE_URL=https://api.openweathermap.org/
OPEN_WEATHER_BASE_URL=https://api.openweathermap.org/
SHOW_LOGS=true
LOG_SQL=true
4 changes: 3 additions & 1 deletion .env.qa
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
OPEN_WEATHER_API_KEY=YOUR_API_KEY
OPEN_WEATHER_BASE_URL=https://api.openweathermap.org/
OPEN_WEATHER_BASE_URL=https://api.openweathermap.org/
SHOW_LOGS=true
LOG_SQL=true
168 changes: 85 additions & 83 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CD
on:
push:
branches:
- main
- release
workflow_dispatch:

jobs:
Expand All @@ -17,10 +17,17 @@ jobs:
with:
token: ${{ secrets.SHOUNAK_GITHUB_TOKEN }}

- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'

- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
cache-key: "flutterCacheV1-:os:-:channel:-:version:-:arch:-:hash:"
pub-cache-key: "flutterPubCacheV1-:os:-:channel:-:version:-:arch:-:hash:"

- name: Setup .env.qa
env:
Expand All @@ -41,9 +48,6 @@ jobs:
- name: Run build_runner
run: derry build_runner

- name: Bump Build Number
run: scripts/bump-build-number.sh

- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
Expand Down Expand Up @@ -88,85 +92,83 @@ jobs:
name: Release iOS to TestFlight
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.SHOUNAK_GITHUB_TOKEN }}

- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true

- name: Setup .env.qa
env:
ENV_FILE: ${{ secrets.ENV_QA }}
run: echo -n $ENV_FILE | base64 --decode > .env.qa

- name: Setup .env.prod
env:
ENV_FILE: ${{ secrets.ENV_PROD }}
run: echo -n $ENV_FILE | base64 --decode > .env.prod

- name: Activate derry
run: flutter pub global activate derry

- name: Get Dependencies
run: flutter pub get

- name: Run build_runner
run: derry build_runner

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Bump Build Number
run: scripts/bump-build-number.sh

- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: chmod u+x scripts/install_certs.sh && scripts/install_certs.sh

- name: Retrieve Export-Options.plist from secrets
env:
PLIST: ${{ secrets.IOS_PLIST }}
PLIST_PATH: ${{ runner.temp }}/options.plist
run: echo -n "$PLIST" | base64 --decode --output $PLIST_PATH

- name: Build the signed ipa
# TODO: Move to derry
run: chmod u+x scripts/build.sh && scripts/build.sh ipa prod --release

- name: Upload the signed ipa to TestFlight
env:
PASSWORD: ${{ secrets.APPSTORE_PASSWORD }}
IPA_PATH: build/ios/ipa/prod.ipa
run: xcrun altool --upload-app --file $IPA_PATH --username "[email protected]" --password $PASSWORD --type ios --verbose
- name: iOS build disabled
run: echo Uncomment "build-ios" job to build and deploy ios app.

# - uses: actions/checkout@v3
# with:
# token: ${{ secrets.SHOUNAK_GITHUB_TOKEN }}
#
# - uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# cache: true
#
# - name: Setup .env.qa
# env:
# ENV_FILE: ${{ secrets.ENV_QA }}
# run: echo -n $ENV_FILE | base64 --decode > .env.qa
#
# - name: Setup .env.prod
# env:
# ENV_FILE: ${{ secrets.ENV_PROD }}
# run: echo -n $ENV_FILE | base64 --decode > .env.prod
#
# - name: Activate derry
# run: flutter pub global activate derry
#
# - name: Get Dependencies
# run: flutter pub get
#
# - name: Run build_runner
# run: derry build_runner
#
# - uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: latest-stable
#
# - name: Install the Apple certificate and provisioning profile
# env:
# BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
# P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
# BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
# KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
# run: chmod u+x scripts/install_certs.sh && scripts/install_certs.sh
#
# - name: Retrieve Export-Options.plist from secrets
# env:
# PLIST: ${{ secrets.IOS_PLIST }}
# PLIST_PATH: ${{ runner.temp }}/options.plist
# run: echo -n "$PLIST" | base64 --decode --output $PLIST_PATH
#
# - name: Build the signed ipa
# # TODO: Move to derry
# run: chmod u+x scripts/build.sh && scripts/build.sh ipa prod --release
#
# - name: Upload the signed ipa to TestFlight
# env:
# PASSWORD: ${{ secrets.APPSTORE_PASSWORD }}
# IPA_PATH: build/ios/ipa/prod.ipa
# run: xcrun altool --upload-app --file $IPA_PATH --username "[email protected]" --password $PASSWORD --type ios --verbose

commit-version-update:
name: Commit Version Change
runs-on: ubuntu-latest
needs: [ build-android, build-ios ]
if: |
always() &&
(needs.build-android.result == 'success' || needs.build-ios.result == 'success')
steps:
- uses: actions/checkout@v3
# Replace with your Personal Access Token
with:
token: ${{ secrets.SHOUNAK_GITHUB_TOKEN }}

- name: Bump Version
run: scripts/bump-build-number.sh

- name: Configure Git
run: |
git config user.name "Github Actions CD"
git config user.email "<>"
name: Commit Version Change
runs-on: ubuntu-latest
needs: [ build-android, build-ios ]
steps:
- uses: actions/checkout@v3
# Replace with your Personal Access Token
with:
token: ${{ secrets.SHOUNAK_GITHUB_TOKEN }}

- name: Bump Version
run: scripts/bump-build-number.sh

- name: Configure Git
run: |
git config user.name "Github Actions CD"
git config user.email "<>"

- name: Commit Version Change
run: scripts/commit-version.sh

- name: Commit Version Change
run: scripts/commit-version.sh
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
with:
channel: 'stable'
cache: true
cache-key: "flutterCacheV1-:os:-:channel:-:version:-:arch:-:hash:"
pub-cache-key: "flutterPubCacheV1-:os:-:channel:-:version:-:arch:-:hash:"

- name: Setup .env.dev
env:
Expand Down Expand Up @@ -54,10 +56,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'

- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
cache-key: "flutterCacheV1-:os:-:channel:-:version:-:arch:-:hash:"
pub-cache-key: "flutterPubCacheV1-:os:-:channel:-:version:-:arch:-:hash:"

- name: Setup .env.dev
env:
Expand Down Expand Up @@ -88,6 +97,8 @@ jobs:
with:
channel: 'stable'
cache: true
cache-key: "flutterCacheV1-:os:-:channel:-:version:-:arch:-:hash:"
pub-cache-key: "flutterPubCacheV1-:os:-:channel:-:version:-:arch:-:hash:"

- name: Setup .env.dev
env:
Expand Down Expand Up @@ -140,6 +151,8 @@ jobs:
with:
channel: 'stable'
cache: true
cache-key: "flutterCacheV1-:os:-:channel:-:version:-:arch:-:hash:"
pub-cache-key: "flutterPubCacheV1-:os:-:channel:-:version:-:arch:-:hash:"

- name: Setup .env.dev
env:
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: E2E
on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e:
name: E2E
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'

- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
cache-key: "flutterCacheV1-:os:-:channel:-:version:-:arch:-:hash:"
pub-cache-key: "flutterPubCacheV1-:os:-:channel:-:version:-:arch:-:hash:"

- name: Setup .env.qa
env:
ENV_FILE: ${{ secrets.ENV_QA }}
run: echo -n $ENV_FILE | base64 --decode > .env.qa

- name: Activate derry
run: dart pub global activate derry

- name: Get Dependencies
run: flutter pub get

- name: Run build_runner
run: derry build_runner

- name: Activate patrol
run: dart pub global activate patrol_cli

- name: Setup android
run: flutter build apk --config-only

- name: Generate Test apks
run: patrol build android --flavor=qa --dart-define=flavor=qa --verbose

- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_TEST_LAB_CREDS }}'

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'

- name: Firebase Test Lab
run: gcloud firebase test android run --type instrumentation --app ./build/app/outputs/apk/qa/debug/app-qa-debug.apk --test ./build/app/outputs/apk/androidTest/qa/debug/app-qa-debug-androidTest.apk --device model=panther,version=33 --environment-variables clearPackageData=true --use-orchestrator

2 changes: 2 additions & 0 deletions .github/workflows/update_goldens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
with:
channel: 'stable'
cache: true
cache-key: "flutterCacheV1-:os:-:channel:-:version:-:arch:-:hash:"
pub-cache-key: "flutterPubCacheV1-:os:-:channel:-:version:-:arch:-:hash:"

- name: Setup .env.dev
env:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ The template also includes a testing setup for
- [`Unit Tests`](test/repository).
- [`Widget Tests`](test/presentation/integration)
- [`Golden Tests`](test/presentation/goldens)
- [`Integration / E2E tests`](integration_test) using [Patrol](https://patrol.leancode.co/)

The test coverage and code quality reporting is done using [`sonarqube`](https://docs.sonarqube.org/latest/).
You can read the documentation about integrating `sonarqube` in you CI workflow [here](https://docs.sonarqube.org/latest/devops-platform-integration/github-integration/#analyzing-projects-with-github-actions).
Expand Down
17 changes: 8 additions & 9 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,11 +22,9 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "com.wednesday.flutter_template"
compileSdkVersion project.properties['flutter.compileSdkVersion'].toInteger()

compileOptions {
Expand Down Expand Up @@ -111,7 +110,7 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.23"

implementation 'androidx.core:core-splashscreen:1.0.0-beta01'

Expand Down
3 changes: 2 additions & 1 deletion android/app/src/androidTest/java/MainActivityTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import androidx.test.platform.app.InstrumentationRegistry;

import com.example.flutter_template.MainActivity;
import com.wednesday.flutter_template
.MainActivity;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Loading
Loading