verygoodopensource / very_good_workflows Goto Github PK
View Code? Open in Web Editor NEWReusable GitHub workflows used at Very Good Ventures ๐ฆ
Home Page: https://workflows.vgv.dev
License: MIT License
Reusable GitHub workflows used at Very Good Ventures ๐ฆ
Home Page: https://workflows.vgv.dev
License: MIT License
Description
While running flutter test
locally produces this output:
โฏ flutter test
Running "flutter pub get" in recipes_repository... 1,415ms
00:03 +5 -1: RecipesRepository getRandomCocktail provides expected cocktail [E]
Expected: Cocktail:<Cocktail(strMeal, strMealThumb, [Ingredient(strIngredient1, strMeasure1), Ingredient(strIngredient2, strMeasure2), Ingredient(strIngredient3, strMeasure3), Ingredient(strIngredient4, strMeasure4), Ingredient(strIngredient5, strMeasure5), Ingredient(strIngredient6, strMeasure6), Ingredient(strIngredient7, strMeasure7), Ingredient(strIngredient8, strMeasure8), Ingredient(strIngredient9, strMeasure9), Ingredient(strIngredient10, strMeasure10), Ingredient(strIngredient11, strMeasure11), Ingredient(strIngredient12, strMeasure12), Ingredient(strIngredient13, strMeasure13), Ingredient(strIngredient14, strMeasure14), Ingredient(strIngredient15, strMeasure15), Ingredient(strIngredient16, strMeasure16), Ingredient(strIngredient17, strMeasure17), Ingredient(strIngredient18, strMeasure18), Ingredient(strIngredient19, strMeasure19), Ingredient(strIngredient20, strMeasure20)])>
Actual: Recipe:<Recipe(strMeal, strMealThumb, [Ingredient(strIngredient1, strMeasure1), Ingredient(strIngredient2, strMeasure2), Ingredient(strIngredient3, strMeasure3), Ingredient(strIngredient4, strMeasure4), Ingredient(strIngredient5, strMeasure5), Ingredient(strIngredient6, strMeasure6), Ingredient(strIngredient7, strMeasure7), Ingredient(strIngredient8, strMeasure8), Ingredient(strIngredient9, strMeasure9), Ingredient(strIngredient10, strMeasure10), Ingredient(strIngredient11, strMeasure11), Ingredient(strIngredient12, strMeasure12), Ingredient(strIngredient13, strMeasure13), Ingredient(strIngredient14, strMeasure14), Ingredient(strIngredient15, strMeasure15), Ingredient(strIngredient16, strMeasure16), Ingredient(strIngredient17, strMeasure17), Ingredient(strIngredient18, strMeasure18), Ingredient(strIngredient19, strMeasure19), Ingredient(strIngredient20, strMeasure20)])>
package:test_api expect
test/src/recipes_repository_test.dart 99:9 main.<fn>.<fn>.<fn>
00:04 +7 -2: RecipesRepository getRandomRecipe provides expected recipe [E]
Expected: Cocktail:<Cocktail(strDrink, strDrinkThumb, [Ingredient(strIngredient1, strMeasure1), Ingredient(strIngredient2, strMeasure2), Ingredient(strIngredient3, strMeasure3), Ingredient(strIngredient4, strMeasure4), Ingredient(strIngredient5, strMeasure5), Ingredient(strIngredient6, strMeasure6), Ingredient(strIngredient7, strMeasure7), Ingredient(strIngredient8, strMeasure8), Ingredient(strIngredient9, strMeasure9), Ingredient(strIngredient10, strMeasure10), Ingredient(strIngredient11, strMeasure11), Ingredient(strIngredient12, strMeasure12), Ingredient(strIngredient13, strMeasure13), Ingredient(strIngredient14, strMeasure14), Ingredient(strIngredient15, strMeasure15)])>
Actual: Recipe:<Recipe(strMeal, strMealThumb, [Ingredient(strIngredient1, strMeasure1), Ingredient(strIngredient2, strMeasure2), Ingredient(strIngredient3, strMeasure3), Ingredient(strIngredient4, strMeasure4), Ingredient(strIngredient5, strMeasure5), Ingredient(strIngredient6, strMeasure6), Ingredient(strIngredient7, strMeasure7), Ingredient(strIngredient8, strMeasure8), Ingredient(strIngredient9, strMeasure9), Ingredient(strIngredient10, strMeasure10), Ingredient(strIngredient11, strMeasure11), Ingredient(strIngredient12, strMeasure12), Ingredient(strIngredient13, strMeasure13), Ingredient(strIngredient14, strMeasure14), Ingredient(strIngredient15, strMeasure15), Ingredient(strIngredient16, strMeasure16), Ingredient(strIngredient17, strMeasure17), Ingredient(strIngredient18, strMeasure18), Ingredient(strIngredient19, strMeasure19), Ingredient(strIngredient20, strMeasure20)])>
package:test_api expect
test/src/recipes_repository_test.dart 142:9 main.<fn>.<fn>.<fn>
00:04 +7 -2: Some tests failed.
in CI, using very_good_workflows
, produces this other output without the details:
Run pub global activate test_coverage
[9](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:9)
Resolving dependencies...
[10](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:10)
+ args 1.6.0 (2.3.0 available)
[11](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:11)
+ async 2.8.2
[12](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:12)
+ charcode 1.3.1
[13](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:13)
+ clock 1.1.0
[14](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:14)
+ collection 1.16.0
[15](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:15)
+ coverage 0.14.2 (1.2.0 available)
[16](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:16)
+ file 5.2.1 (6.1.2 available)
[17](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:17)
+ glob 1.2.0 (2.0.2 available)
[18](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:18)
+ intl 0.17.0
[19](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:19)
+ js 0.6.4
[20](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:20)
+ json_annotation 3.1.1 (4.4.0 available)
[21](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:21)
+ lcov 5.7.0 (6.0.0 available)
[22](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:22)
+ logging 0.11.4 (1.0.2 available)
[23](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:23)
+ meta 1.7.0
[24](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:24)
+ node_interop 1.2.1 (2.1.0 available)
[25](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:25)
+ node_io 1.2.0 (2.1.0 available)
[26](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:26)
+ package_config 1.9.3 (2.0.2 available)
[27](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:27)
+ path 1.8.1
[28](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:28)
+ pedantic 1.11.1
[29](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:29)
+ source_maps 0.10.10
[30](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:30)
+ source_span 1.8.2
[31](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:31)
+ stack_trace 1.10.0
[32](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:32)
+ string_scanner 1.1.0
[33](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:33)
+ term_glyph 1.2.0
[34](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:34)
+ test_coverage 0.5.0
[35](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:35)
+ vm_service 5.5.0 (8.2.2 available)
[36](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:36)
Downloading test_coverage 0.5.0...
[37](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:37)
Downloading glob 1.2.0...
[38](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:38)
Downloading coverage 0.14.2...
[39](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:39)
Downloading package_config 1.9.3...
[40](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:40)
Downloading lcov 5.7.0...
[41](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:41)
Downloading json_annotation 3.1.1...
[42](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:42)
Downloading args 1.6.0...
[43](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:43)
Downloading node_io 1.2.0...
[44](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:44)
Downloading node_interop 1.2.1...
[45](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:45)
Downloading logging 0.11.4...
[46](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:46)
Downloading file 5.2.1...
[47](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:47)
Downloading intl 0.17.0...
[48](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:48)
Downloading clock 1.1.0...
[49](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:49)
Downloading pedantic 1.11.1...
[50](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:50)
Downloading vm_service 5.5.0...
[51](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:51)
Building package executables...
[52](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:52)
Built test_coverage:test_coverage.
[53](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:53)
Installed executable test_coverage.
[54](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:54)
Activated test_coverage 0.5.0.
[55](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:55)
Found 1 test files.
[56](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:56)
Generated test-all script in test/.test_coverage.dart. Please make sure it is added to .gitignore.
[57](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:57)
Unhandled exception:
[58](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:58)
Tests failed with exit code 255
[59](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:59)
#0 runTestsAndCollect (package:test_coverage/src/functions.dart:122:5)
[60](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:60)
<asynchronous suspension>
[61](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:61)
#1 main (file:///home/runner/.pub-cache/hosted/pub.dartlang.org/test_coverage-0.5.0/bin/test_coverage.dart:60:3)
[62](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:62)
<asynchronous suspension>
[63](https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true#step:7:63)
Error: Process completed with exit code 255.
Link to the build: https://github.com/VGVentures/mealify/runs/5737269551?check_suite_focus=true
Expected Behavior
Local and CI produce the same feedback.
Description
As a developer, when developing pure Dart packages, I would sometimes like to control which folders get checked by the analyzer, as well as what folders get checked by code coverage.
For example, in a dart_frog project, I want to analyze and report on the routes
folder.
Current Workaround
Currently, to solve this, we have to copy the content in the https://github.com/VeryGoodOpenSource/very_good_workflows/blob/main/.github/workflows/dart_package.yml
file, then tweak the Analyze
and Check Code Coverage
steps to point to the folders I'd like to use.
Proposed Solution
I propose adding two optional inputs to the `https://github.com/VeryGoodOpenSource/very_good_workflows/blob/main/.github/workflows/dart_package.yml workflow:
report_on
: passed to the Check Code Coverage
step, defaults to lib
analyze_on
: passed to the Analyze
step, defaults to lib test
Description
When building ci with flutter 3.10 and [workflows/flutter_package.yml@v1](uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1)
I get The "format" command is deprecated. Please use the "dart format" sub-command instead, which has the same command-line usage as "flutter format".
Steps To Reproduce
Expected Behavior
It checks for formatting and continues to the next step
Additional Context
Flutter 3.10.0+ problem
Description
If you provide an invalid JSON in secrets.PUB_CREDENTIALS, the action tries to authenticate using OAuth. This just waits forever, meaning that the action stalls and only ends once GitHub times it out (6h of valuable Actions minutes for me ๐ฅฒ)
(Thanks for the awesome actions you provide!)
Steps To Reproduce
Expected Behavior
The action should fail if it didn't get any valid credentials
Additional Context
Validating package...
Warning: could not load the saved OAuth2 credentials: FormatException: Failed to load credentials: invalid JSON.
[REDACTED]
Obtaining new credentials...
Pub needs your authorization to upload packages on your behalf.
In a web browser, go to https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&response_type=code&client_id=818368855108-8grd2eg9tj9f38os6f1urbcvsq399u8n.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A45871&code_challenge=ZDNrLEIfeRs1gmT1yPcofUKYq2H6s7fMx7FXhmqBBT8&code_challenge_method=S256&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
Then click "Allow access".
Waiting for your authorization...
Error: The operation was canceled.
Description
We need to lock the CLI in the workflows in case we ever have a breaking change on it, currently it installs the latest and if people use older version of the workflows when there is a breaking change it will break that workflow accidentally.
Hello,
Can you tell me how can I execute generating a firebase_option.dart file before running that workflow?
I need to run echo '${{ secrets.FIREBASE_OPTIONS }}' | base64 --decode > lib/firebase_options.dart
because otherwise analyzer doesn't want to go through.
Description
Typically the Install dependencies
step takes somewhere between 2-3 min. I was wondering if there was a way to cache dependencies across branches? I'm not sure if pubspec.lock is taken into account when caching, but I think it should not be the only indicator of reusing cache as usually most of the dependencies stays at the same version.
One idea I had was that once the first very_good packages get
is run for the top package (app), then all the subsequent runs could use --offline
flag to not refetch dependencies via network.
My workflow
name: app
on:
- pull_request
jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
coverage_excludes: "*.g.dart"
flutter_channel: "stable"
flutter_version: "3.3.4"
working_directory: "."
test_recursion: false
min_coverage: 0
Expected Behavior
Resolving time should be close to the local time e.g. below 1:30 min.
Screenshots
GitHub Action:
When running locally on M1 Pro the total time is 41.75 s
time very_good packages get --recursive
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/[REDACTED] (3.3s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app (5.0s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.7s)6s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (3.0s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.6s)6s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.8s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.5s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.0s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (4.3s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.1s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.6s)6s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (3.9s)9s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (3.0s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (1.7s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.8s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (3.0s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.7s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.9s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (3.1s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (1.7s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (0.9s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (1.8s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (3.2s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.9s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.2s)1s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (0.9s)
โ Running "flutter packages get" in /Users/dominik/Projects/[REDACTED]/[REDACTED]-app/packages/[REDACTED] (2.8s)7s)
When running flutter packages get --offline
for the main app the total time is around 2 seconds vs 3.3 seconds
Description
So I'm pretty new to very_good_* and github actions. Trying to figure stuff out and using the opinionated flutter project to improve my skills. But I'm working through some versioning issues. Currently on an automatic github actions build after pushing, the action is failing because of a mismatch of versions.
Edit I'm using the flutter package workflow that comes standard with a new flutter project from the cli.
Steps To Reproduce
The error is:
ERR : The current Dart SDK version is 2.17.0.
|
| Because four_gospels requires SDK version >=2.18.0 <3.0.0, version solving failed.
Expected Behavior
It should resolve properly. Do I have to tell my repo or something that I updated dart to 2.18? I don't really get how this works.
It would be nice for the build not to fail if the code is not formatted like the Dart linter suggests.
Is there any way to change this?
Description
As a developer I would like my PR titles to conform to my spell checks
Description
Since there is now a license_check
workflow (#154) we should publish it and update documentation related to it.
Tasks
license_check
workflowlicense_check
workflow documentation with an example of how to use the workflowDescription
Currently there isn't a good way (or I'm ignorant to a way) to run workflows within packages or apps in a monorepo on github actions.
Steps To Reproduce
I've created a monorepo setup with melos, and have a root .github/workflows/main.yaml file. I've tried a number of permutations of the github workflow file to have it run the reusable verygoodworkflows within each of my packages and apps. The issue that I'm filing is that there isn't an input available in the workflows to set the current working directory so that the workflow can operate on the app or package.
Any additional insight into this would be appreciated
As an engineer, it could be useful to see the failed golden tests after a failed run. Uploading the failures as artifacts would tackle that.
import 'package:flutter/foundation.dart';
String foo() {
if (kReleaseMode) {
return null;
}
return _calculateABunchOfStuffAndReturnALongString();
}
To cover source code above, --dart-define option is needed.
For example, to testing device in release mode,
flutter test --dart-define=dart.vm.product=true
Description
I think it would be useful to have some optional ssh_key input, that takes ssh key from github secrets and installs it before fetching dependencies
As described on #31 (comment), support the following structure of multiple packages in a repository:
<repository root (flutter app)>
| - .github/
| - workflows/
| - root_package.yaml
| - package_check_workflow.yaml
| - sub_packages.yaml
| - packages/
| - sub_package_1
| - .github/
| - workflows/
| - sub_package_1.yaml
| - sub_package_2
| - .github/
| - workflows/
| - sub_package_2.yaml
| - sub_package_3
| - .github/
| - workflows/
| - sub_package_3.yaml
| - sub_package_4
| - .github/
| - workflows/
| - sub_package_4.yaml
| - sub_package_5
| - .github/
| - workflows/
| - sub_package_5.yaml
...
Description
Action fails to run because it can't load the credentials:
Warning: could not load the saved OAuth2 credentials.
Obtaining new credentials...
Pub needs your authorization to upload packages on your behalf.
I'm running this workflow:
jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_pub_publish.yml@v1
with:
pub_credentials: secrets.PUB_CREDENTIALS
in PUB_CREDENTIALS y copy & pasted the contents of pub-credentials.json
https://workflows.vgv.dev/docs/workflows/flutter_pub_publish#example-usage
Description
There is a fix, fix: runnable skipped tests in Dart packages #168 to be released on the dart_packages workflow.
Hello, at this line you may use path:
or path-ignore:
to exclude code check if nothing changed.
You can add workflow_dispatch:
to make available manual pipeline launching.
And you can use pattern matching with glob syntax for branches
Also can add some useful parameters for every job, e.g:
name: CLIENT / CHECKOUT
on:
push:
branches:
- 'feature/**'
- 'bugfix/**'
- 'hotfix/**'
- 'support/**'
paths:
- 'client/lib/**.dart' # <== PIPELINE RUNNING ONLY ON PUSH IF CODE CHANGED
pull_request:
branches:
- 'feature/**'
- 'bugfix/**'
- 'hotfix/**'
- 'support/**'
paths:
- 'client/lib/**.dart' # <== PIPELINE RUNNING ONLY ON PR IF CODE CHANGED
workflow_dispatch: # <== MANUAL RUN
jobs:
check-client:
name: 'Checkout client' # <== NAME
timeout-minutes: 5 # <== TIMEOUT
runs-on: ubuntu-latest
container:
image: plugfox/flutter:beta # <== ALPINE FLUTTER VERSION, ONLY 35 MB
options: --user root
env:
working-directory: ./client # monorepo with dart code inside "client" directory
steps:
- name: ๐ Get the latest code
uses: actions/checkout@v2
- name: ๐ Cache pub modules
uses: actions/cache@v2
env:
cache-name: cache-pub-modules
with:
path: |
$PWD/.pub_cache/
key: ${{ runner.os }}-dart
- name: ๐๏ธ Export pub cache directory
run: export PUB_CACHE=$PWD/.pub_cache/
- name: ๐ Get dependencies
working-directory: ${{ env.working-directory }}
run: |
flutter pub get \
&& flutter pub global activate **intl_utils**
- name: ๐๏ธ Codegen
working-directory: ${{ env.working-directory }}
run: |
flutter pub run build_runner build --delete-conflicting-outputs --release ; \
flutter pub global run intl_utils:generate
- name: โ๏ธ Check sources with analyzer
working-directory: ${{ env.working-directory }}
run: |
flutter analyze --no-pub --current-package --congratulate \
--current-package --no-fatal-infos --fatal-warnings \
--no-preamble --write=analyze.txt
- name: ๐ Upload result
uses: actions/upload-artifact@v2
with:
name: test
if-no-files-found: ignore
retention-days: 7
path: |
client/analyze.txt
You can improve your flutter/dart code with aditional linter rules from dart-code-metrics
And their action for CI: dart-code-metrics-action
Description
Running out of the box the semantic pull request action will fail with an error:
Error: Resource not accessible by integration
This is because permissions within the GitHub repository need to be updated (from Settings > Actions > General) to allow Read and Write, see image under Screenshots section.
Another option is to include permisisons within the yaml example yaml, see here.
Expected Behavior
To include information about the required permissions to be able to use the semantic_pull_request
workflow.
Screenshots
Description
There is a Dart hidden argument (--no-example
) to avoid getting packages on an example/
when running dart pub get
. I would like to be able to toggle this through a workflow parameter.
Additional Context
Including this argument would help using Very Good Workflows on Formz, where the main package does not depend on Flutter but the example does.
Description
Seems that the coverage_excludes is not working for Dart packages.
For example I have this in my GitHub workflow file:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
coverage_excludes: '*.freezed.dart'
dart_sdk: 'stable'
But then the coverage on the GitHub action shows that I don't have these lines covered:
/home/runner/work/my_api_client_library/my_api_client_library/lib/src/models/config_file_record/config_file_record.freezed.dart: 12, 14, 23, 24, 26, 27, 29, 44, 51, 57, 59, 63, 85, 87, 89, 95, 97, 101, 121, 123, 135, 137, 139, 143, 165, 168
- /home/runner/work/my_api_client_library/my_api_client_library/lib/src/models/config_files_response/config_files_response.freezed.dart: 12, 14, 23, 24, 26, 27, 29, 44, 51, 57, 59, 63, 85, 87, 89, 95, 97, 101, 130, 132, 145, 147, 148, 150, 154, 177, 180
Steps To Reproduce
Expected Behavior
It's expected to pass the coverage GitHub action without testing the ignored files.
Description
As a user of the Dart Package Very Good Workflow I would like to have a documented method on how to provide environment variables to be consumed by Platform.environment
.
For example:
MY_VAR="true" dart test
Description
Currently you can make a middleware of a middleware. I think this is not intended, but if it is, feel free to close the issue.
Steps To Reproduce
dart_frog create sample
dart_frog new middleware /
dart_frog new _middleware
Expected Behavior
To get an error message when creating the middleware of a middleware.
Screenshots
Result after doing the steps detailed above:
Description
In the documentation flutter_version
is optional but when is not informed Setup Flutter
step fails.
Steps To Reproduce
flutter_package.yml
flutter_version
Example:
jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
coverage_excludes: "*.g.dart"
test_recursion: true
Screenshots
If applicable, add screenshots to help explain your problem.
Description
The "misspelt" words are in code blocks. This behavior is new because it code blocks didn't trigger errors in the past.
Here is the relevant run: https://github.com/jinyus/dart_beacon/actions/runs/7616833260/job/20744501121
Description
Currently, the documentation website has no information about the cspell.json
file structure.
Very Good Core has a useful cspell.json
file, see here. Could be added as an example within Example Usage.
Expected Behavior
The documentation should provide more guidance about how to structure the cspell.json
. Ideally, by showing an example.
Description
Hello, I really don't know if this is the right place to make this question, but after a full day of research trying to find help of some sort about this issue that I have, I don't know were else I can go to ask about it.
In my current job we are using the very good core
template, which has a lot of tools and rules to follow, which we are not using/following properly (the project was already started before I arrived to work on it). So I convinced them that its the right choice to restart the project and follow the rules and the recomendations stablished by the template. But now I understand that the main issue was that, since we're using Bitbucket
for our repo hosting, it was not possible to use the very good core
template to its fullest, so I started to migrate the workflow the best I could to be used on with Bitbucket Pipelines
.
So far I made possible to get 4 out of the 5 steps:
The only one that I'm missing still is the Check Code Coverage
one, but since it's a github action by itself, I researched on how to run the internal js scripts inside the action, but I haven't been able to do it right.
My question:
It's possible to run the action in the console with the node
command to run the action steps? if its possible, which files does the console needs to know in the directory to make it work? since it seems that the files depends from some others, just that I haven't figure it out yet, this is not my forte :V.
This is only to know if its gonna be possible to make the full migration from GitHub Actions
to Bitbucket Pipelines
, but if at the end this is not something that the team developing this have in mind that can be possible, then I guess I'll leave it like that.
Hope to hear something about soon, have a great day!
PT: since the issue template only available was only the bug one, the issue has the bug tag, even if its not one, I was not able to notice/fix it before publishing the issue, my bad.
To gather function level coverage information, pass --function-coverage to collect_coverage
:
dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=NNNN script.dart
dart pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates --function-coverage
To gather branch level coverage information, pass --branch-coverage to both collect_coverage and the Dart command you're gathering coverage from:
dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=NNNN --branch-coverage script.dart
dart pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates --branch-coverage
Branch coverage requires Dart VM 2.17.0, with service API v3.56. Function, branch, and line coverage can all be gathered at the same time, by combining those flags:
dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=NNNN --branch-coverage script.dart
dart pub global run coverage:collect_coverage --uri=http://... -o coverage.json --resume-isolates --function-coverage --branch-coverage
These flags can also be passed to test_with_coverage:
pub global run coverage:test_with_coverage --branch-coverage --function-coverage
As a developer with multiple packages in the same repository, it is necessary to create a new workflow for each new repository
It is also necessary manually configure each these workflows with the right on
triggers to filter workflow runs.
On top that, if a package has any local path dependency, it is necessary to manually map these dependencies to run the workflow whenever they change.
This is error prone and it is difficult to keep different files standardized.
In this proposal, packages with multiple dart and flutter packages would have a single top workflow (just like the existing ones) and would optionally receive multiple paths in the working_directory
field. Then the very_good_workflow would take care of creating steps dynamically.
Usage example on a workflow for dart sub packages
jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
coverage_excludes: "*.g.dart"
dart_sdk: "stable"
working_directory: examples/my_dart_package examples/my_other_dart_package
# or
working_directory: "["examples/my_dart_package ", "examples/my_other_dart_package" ]"
For crating steps for each passed workflow we should use matrix. See discussion.
Here, sub packages would heave each its own .github/workflows
structure. This would require the following changes:
very_good_core
would include a noop job for eventual sub packages to serve as an example;dart_pkg
and flutter_pkg
templates for very_good create
would include a .github/workflows
structure with workflow ready to be called by a top workflow;/packages
or any dir with a pubspec.yaml
file, to be discussed) and warn for the absence of a workflow for them (unless a specific directory is explicitly ignored).I believe that regardless of which hypothesis is chosen, restricting workflow runs for a sub package has its own value.
jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
coverage_excludes: "*.g.dart"
dart_sdk: "stable"
# restrict runs
restrict_runs: true # or "true"
Then we could restrict runs to only when the package path has changed.
2. For the problem of internal dependencies, investigate how the output of flutter pub deps
could help us here.
Original Issue: VeryGoodOpenSource/very_good_cli#354
Description
If you create packages/package-name
, it will have independent tests for this package alone. Very good cli should run test recursively in github action to include all testcases from main repo as well as from repos like packages
.
Steps To Reproduce
very_good
clivery_good create packages/test_lib -t dart_pkg
which will generate packages/test_lib
inside main projectExpected Behavior
very_good test --recursive
you will see 1 testcase fail, and it should fail in github action as well.Screenshots
Additional Context
--recursive
or -r
flag in testcase.As a Dart/Flutter package developer, I want to have a reusable workflow that will automated the publish to pub.dev.
Description
When using dart_package workflow, the tests fail to collect coverage.
Run dart test --coverage=coverage && dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib
โ
test/src/confirm_email_test.dart: ConfirmEmail constructors pure creates correct instance
....
โ
test/src/email_test.dart: Email validator is valid when email is valid
๐ 2[7](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:7:7) tests passed.
Unhandled exception:
FormatException: Unexpected character (at character 1)
# This file is deprecated. Tools should instead consume
^
#0 throwError (package:package_config/src/errors.dart:32:35)
#1 parsePackageConfigString (package:package_config/src/package_config_json.dart:54:12)
#2 PackageConfig.parseString (package:package_config/src/package_config.dart:94:7)
#3 Resolver._parsePackages (package:coverage/src/resolver.dart:115:23)
#4 Resolver.create (package:coverage/src/resolver.dart:34:13)
#5 HitMap.parseJson (package:coverage/src/hitmap.dart:45:37)
#6 HitMap.parseFiles (package:coverage/src/hitmap.dart:173:41)
#7 main (file:///home/runner/.pub-cache/hosted/pub.dartlang.org/coverage-1.3.0/bin/format_coverage.dart:66:31)
#[8](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:7:8) _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:2[9](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:7:9)5:32)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:[12](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:7:12))
Error: Process completed with exit code [25](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:7:25)5.
Additional Context
Workflow:
name: form_inputs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths:
- "packages/form_inputs/**"
- ".github/workflows/form_inputs.yaml"
jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
coverage_excludes: "*.g.dart"
dart_sdk: "stable"
working_directory: "packages/form_inputs"
Job setup:
Current runner version: '2.291.1'
Operating System
Ubuntu
[2](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:1:2)0.04.4
LTS
Virtual Environment
Environment: ubuntu-20.04
Version: 2022050[3](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:1:3).1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20220503.1/images/linux/Ubuntu200[4](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:1:4)-Readme.md
Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20220[5](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:1:5)03.1
Virtual Environment Provisioner
1.0.0.0-main-20220421-1
GITHUB_TOKEN Permissions
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v2' (SHA:7884fcad[6](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:1:6)b5d53d10323aee[7](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:1:7)24dc6[8](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:1:8)d8b[9](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:1:9)096a2e)
Download action repository 'dart-lang/setup-dart@v1' (SHA:6a218f2413a3e78e9087f638a238f6b40893203d)
Download action repository 'VeryGoodOpenSource/very_good_coverage@v1' (SHA:feed99cc060453828a8f[12](https://github.com/org/repo/runs/6402844755?check_suite_focus=true#step:1:12)e74b404baace8e4502)
Description
Hey, I've been using very_good_workflow for a while but I've some ideas that I feel like might be a good enhancement to this tool cause I feel like It's good to first write my idea here before making my own custom workflow.
But to the point, as a developer, I would like to check test coverage for the whole project with packages that I wrote, and here's the first problem cause flutter test --coverage won't do it so locally I've done it by using melos package that I'm surprised that you're not using and It's definitely worth to check out, cause with simple config in melos.yaml
name: example
packages:
- "*"
- packages/**
and then running melos exec flutter test --coverage --test-randomize-ordering-seed random
will automatically go through all tests directories in the project directory and packages directory.
Second thing is to merge all lcov.info files into one and check/generate report from this one file which is also easily done with melos and coverde packages that are CLI tools you have to only run melos exec --file-exists=coverage/lcov.info -- coverde filter --input ./coverage/lcov.info --output MELOS_ROOT_PATH/coverage/filtered.lcov.info --filters \.g\.dart
and it will output combined file named filtered.lcov.info
in coverage folder so it would be awesome to be able to at least pass this lcov file to workflow, but even better if that would be able happens by itself cause coverde and melos are fully dart packages that can be installed by dart pub global activate
.
That can be even more compact by adding this to melos.yaml
name: example
packages:
- "*"
- packages/**
scripts:
M:
description: Merge all packages coverage tracefiles ignoring data related to generated files.
run: >
coverde rm MELOS_ROOT_PATH/coverage/filtered.lcov.info &&
melos exec flutter test --coverage --test-randomize-ordering-seed random &&
melos exec --file-exists=coverage/lcov.info -- coverde filter --input ./coverage/lcov.info --output MELOS_ROOT_PATH/coverage/filtered.lcov.info --filters \.g\.dart &&
coverde value -i coverage/filtered.lcov.info --no-verbose
with that configuration, we can just run melos M
('M' is really just a random name specified in yaml above) and it will delete previously merged lcov, run ALL test that will generate coverage and then merge them to filtered.lcov.info and then print coverage value, you can easily change coverde value
to coverde check
, to output coverage %
I feel like it might be a good improvement to this tool that everybody could use so that's why I want to share my thoughts here. So please let me know what you think about it.
Description
I'm trying to setup a workflow for my project which contains multiple projects. One of them was flutter. I checked the readme of very_good_workflow which states that working_directory
can help me with running this workflow in sub directory.
Steps To Reproduce
name: medalthea
on: [pull_request, push]
env:
working_directory: "./medalthea/."
jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
flutter_channel: stable
flutter_version: 2.10.0
I tried "./medalthea", "medalthea", etc but none of them worked.
Expected Behavior
I just want to make this workflow to work in my flutter project dir.
The current coverage version is pinned to 1.2.0, see:
Currently, the latest coverage version is 1.6.3, see coverage's pub page. It would be ideal if the workflow used the latest version so the newest fixes apply.
I'm unaware of why the version is currently pinned, if the reason is stronger than the need to update then a valid solution would be to document this reasoning.
As a developer I will sometimes have some tests that I skip locally but run in CI. The Dart CLI exposes a "run-skipped" parameter that allows doing so, however the dart_package
doesn't use the parameter, see:
I would like to have a new parameter "run-skipped" that is set to false by default and can be enabled by the user.
The flutter_package
workflow can also benefit of this change.
Description
Seems that flutter format will be deprecated and need to use dart format instead
$ flutter format --set-exit-if-changed lib test
[!] The "format" command is deprecated and will be removed in a future version of Flutter. Please use the "dart format" sub-command instead, which takes all of the same command-line arguments as "flutter format".
Steps To Reproduce
flutter format --set-exit-if-changed lib test
Expected Behavior
No warning and no errors on running flutter format --set-exit-if-changed lib test
Additional Context
flutter format --set-exit-if-changed lib test
raised an error
dart format --set-exit-if-changed lib test
format with success
Description
semantic_pull_request
workflow fails when using exclamation point to mark commit as breaking change.
Example: feat!: this is breaking commit
.
Expected Behavior
Finish successfully when using "breaking change" syntax.
Additional context
semantic-release/semantic-release#2339
As a developer, I may have directories which I wish to exclude from 'packages get' when using the flutter_package
workflow but currently, it's not possible to exclude directories from very_good packages get --recursive
.
Description
I'm testing your workflow and have no problems with generated dart code. How can I exclude that files from the "Check Formatting" step?
Steps To Reproduce
Expected Behavior
A way to exclude generated files with patterns like coverage_excludes: '*.g.dart *.freezed.dart'
Screenshots
No.
Additional Context
Nopeยฒ
Description
Using default cache-key will create a lot of caches (out of limit 10GB)
Steps To Reproduce
Expected Behavior
Have a config for cache-key
Screenshots
Not have
Additional Context
No
Description
The repository has grown significantly. Currently reading the parameters for a specific worfklow requires a decent amount of scrolling or searching.
Proposal
Proposal 1: Use markdown tables to simplify the readability.
Proposal 2: Create files documenting each workflow.
(cc: @wolfenrain)
Description
Workflow fails on cloning flutter step
Steps To Reproduce
Expected Behavior
Workflow passes
Screenshots
n/a
Additional Context
The builds on this commit are red b62ee03
Description
When running dart workflow the work flow fails right after all tests pass.
๐ 4 tests passed.
Package spec ".packages" not found, or not a file.
Steps To Reproduce
I have a simple package repository experiencing the issue:
https://github.com/Luckey-Elijah/cached_streamable/runs/8105451027?check_suite_focus=true
Additional Context
I image that this is due to the latest dart version (2.18) deprecating the .packages
usage/directory
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.