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

ci: reland Dart analyzer #1559

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
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
32 changes: 32 additions & 0 deletions .github/workflows/analyzer.yml
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"
Comment on lines +4 to +8
Copy link
Member

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

Copy link
Member Author

@validcube validcube Dec 11, 2023

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.

pull_request:
branches: [ "main", "dev" ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be relevant for all branches?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause the analyser to run on unintended branches like compose-dev

Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

@Ushie Ushie Dec 11, 2023

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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