Skip to content

Commit

Permalink
feat: update test, ci, and up to flutter 3.13 (#10)
Browse files Browse the repository at this point in the history
* feat: update test, ci, and up to flutter 3.13

* chore: update codeowner

* ci: add master branch

* ci: remove spell check
  • Loading branch information
adryanev authored Sep 17, 2023
1 parent 767bfa4 commit ce6b88d
Show file tree
Hide file tree
Showing 39 changed files with 2,092 additions and 408 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 @@
# Every request must be reviewed and accepted by

* @adryanev
27 changes: 18 additions & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<!--
Thanks for contributing!
## Description

Provide a description of your changes below and a general summary in the title
What:

Please look at the following checklist to ensure that your PR can be accepted quickly:
-->
1. What changes did you make?

## Description
How:

<!--- Describe your changes in detail -->
1. How do you change it?
2. If it is a breaking change, code refactor. Explain how others should migrate to the new API.

Why:

1. What is the reason for the change?
2. If it is a breaking change, code refactor. What justifies the change?

## Type of Change

<!--- Put an `x` in all the boxes that apply: -->
---

## Type of Change

- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
Expand All @@ -21,3 +26,7 @@
- [ ] ✅ Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore

## Code Checklist

- [ ] Tested [test_documentation_video_link_here] or a screenshot.
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "/"
schedule:
interval: "daily"
36 changes: 36 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ci/cd:
- .github/workflows/*

core:
- lib/core/**

assets:
- assets/**

domain:
- lib/features/**/domain/**

data:
- lib/features/**/data/**

presentation:
- lib/features/**/presentation/**

feature:
- lib/features/**

shared:
- lib/shared/**

test:
- test/**

documentation:
- README.md
- ./*.md

l10n:
- l10n/**

router:
- lib/app/router/**
17 changes: 17 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Always validate the PR title, and ignore the commits
titleOnly: true
# By default types specified in commitizen/conventional-commit-types is used.
# See: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json
# You can override the valid types
types:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert
22 changes: 11 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
name: template

concurrency:
group: $-$
cancel-in-progress: true

on:
push:
branches:
- main
- master
- staging
pull_request:
branches:
- main
- master
- staging

jobs:
semantic-pull-request:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1

build:
defaults:
run:
Expand All @@ -23,12 +24,11 @@ jobs:

steps:
- name: 📚 Git Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.3.10
channel: stable
cache: true

Expand All @@ -39,10 +39,10 @@ jobs:
very_good packages get --recursive
- name: 🧬 Generate Code
run: flutter pub run build_runner build --delete-conflicting-outputs
run: dart run build_runner build --delete-conflicting-outputs

- name: ✨ Check Formatting
run: flutter format --set-exit-if-changed lib test
run: dart format --set-exit-if-changed lib test

- name: 🕵️ Analyze
run: flutter analyze lib test
Expand All @@ -51,8 +51,8 @@ jobs:
run: very_good test -j 4 --optimization --coverage --test-randomize-ordering-seed random

- name: 📊 Check Code Coverage
uses: VeryGoodOpenSource/very_good_coverage@v1
uses: VeryGoodOpenSource/very_good_coverage@v2
with:
path: ./coverage/lcov.info
exclude: "*.g.dart *.freezed.dart *.config.dart *.gen.dart"
min_coverage: 60
min_coverage: 0
13 changes: 13 additions & 0 deletions .github/workflows/pr-labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Pull Request Labeling

on:
- pull_request

jobs:
triage:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
43 changes: 43 additions & 0 deletions .github/workflows/semantic-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Lint PR

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
permissions: write-all
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ unlinked_spec.ds
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
**/android/.idea/
**/android/app/debug
**/android/app/profile
**/android/app/release
*.jks

# iOS/XCode related
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ firebase-prod:

.PHONY: analyze
analyze:
@flutter analyze lib test
@dart analyze lib test

.PHONY: format
format:
@flutter format --set-exit-if-changed lib test
@dart format --set-exit-if-changed lib test

.PHONY: prepare
prepare: fix format analyze
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:very_good_analysis/analysis_options.3.0.1.yaml
include: package:very_good_analysis/analysis_options.5.1.0.yaml
linter:
rules:
public_member_api_docs: false
Expand Down
2 changes: 0 additions & 2 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

Expand Down
2 changes: 1 addition & 1 deletion ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
Loading

0 comments on commit ce6b88d

Please sign in to comment.