-
-
Notifications
You must be signed in to change notification settings - Fork 763
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
ci: reland Dart analyzer #1559
ci: reland Dart analyzer #1559
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Analyze Code | ||
|
||
on: | ||
push: | ||
branches: dev | ||
paths: | ||
- "**.dart" | ||
- ".github/workflows/analyze.yml" | ||
pull_request: | ||
branches: [ "main", "dev" ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it be relevant for all branches? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will cause the analyser to run on unintended branches like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No because the workflow isn't in that branch and also even if it is, there's the path check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Limit to only supported branch is safer than not specifying branch at all; in the future we might introduce analyser for Compose branch or something unrelated to Flutter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This workflow won't run in the compose-dev branches because the workflow file isn't in the branch, isn't that the case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, but in the future we might introduce Compose analyser which can cause problems with running Dart-specific command. |
||
paths: | ||
- "**.dart" | ||
- ".github/workflows/analyze.yml" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
cache: true | ||
- name: Install Flutter dependencies | ||
run: flutter pub get | ||
- name: Generate files with Builder | ||
run: flutter packages pub run build_runner build --delete-conflicting-outputs | ||
- name: Analyze code | ||
uses: ValentinVignal/[email protected] | ||
with: | ||
fail-on: info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think on push is necessary, the code is already pushed
And this would duplicate runs on PRs from dev to main, which already covers the use of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some cases where we have—or, would want to push directly to the repository rather than make a pull request, could be situations like—critical bug fixes, string changes, miscellaneous stuff.
We wanna have the analyser running at all time so that we can check if one of our commit can causes build to fail; even if the chance of it failing are small.