Skip to content

Commit

Permalink
ci: add gh workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-the-shark committed Jul 25, 2024
1 parent 3626442 commit 99ab12a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/lint_and_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint & formatting

on:
push:
branches: ["**"]
pull_request:
branches: ["**"]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
channel: "stable"
- run: flutter --version

- name: Install dependencies
run: dart pub get

- name: generate files
run: dart run build_runner build --delete-conflicting-outputs

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

- name: Analyze project source
run: flutter analyze --fatal-infos --no-pub
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,23 @@ fvm flutter run
3. Api helper module instructions: https://github.com/Solvro/topwr-mobile/tree/main/lib/api_base
4. We use `flutter_gen` for generating asset paths: https://pub.dev/packages/flutter_gen

# Before you push a commit
- run the linter
```bash
flutter analyze
```
- if you have any problems listed, try to autofix with
```bash
dart fix --apply
```
- run `analyze` again, if problems still persist, correct them manually. If you disagree with some of the rules, we can still discuss and adjust them. Hit me up @simon-the-shark or open an issue.
- run formatter
```bash
dart format .
```
## Github workflow
Don't worry if you've forgotten about the steps, automatic gh action will run the checks for you and notify if somthing's wrong.


## Working with git

Expand Down

0 comments on commit 99ab12a

Please sign in to comment.