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(melos): スクリプトの命名変更 #357

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/check-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
run: melos list --cycles

- name: Run test
run: melos run report_test --no-select
run: melos run report:test --no-select
continue-on-error: true

# https://github.com/andstor/file-existence-action
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
- name: Report custom_lint result
run: |
echo "::add-matcher::.github/problem_matchers/custom_lint.json"
melos run report_custom_lint:ci --no-select || result=$?
melos run ci:report:custom_lint --no-select || result=$?
echo "::remove-matcher owner=custom_lint::"

if [ -n "$result" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wc-check-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
restore-keys: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }}

- name: Regenerate code
run: melos run regenerate_code --no-select
run: melos run gen --no-select

- name: Check difference
run: |
Expand Down
4 changes: 2 additions & 2 deletions docs/ja/NEW_FEATURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const settingShellBranch = TypedStatefulShellBranch<SettingShellBranch>(
`./apps/app`内で以下のコマンドを実行しnavigatorとappのコード生成を行う。

```shell
melos run regenerate_by_using_build_runner --no-select
melos run gen:build --no-select
Copy link
Member Author

Choose a reason for hiding this comment

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

memo-badge

関連箇所を併せて変更しています。

```

**7. 画面遷移**
Expand Down Expand Up @@ -235,7 +235,7 @@ class MainPageShellRoute extends StatefulShellRouteData {
**5. `./apps/app`にて、go_router周りのコード生成**

```shell
melos run regenerate_by_using_build_runner --no-select
melos run gen:build --no-select
```

**6. 新しくできたボトムナビゲーションのタブを押して画面遷移するか確認する**
29 changes: 15 additions & 14 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ scripts:
# スクリプトを Flutter と Dart に分けている
test:
steps:
- test_flutter
- test_dart
- test:flutter
- test:dart

test_flutter:
test:flutter:
run: flutter test
exec:
concurrency: 1
packageFilters:
dependsOn: flutter_test
dirExists: test

test_dart:
test:dart:
run: dart test
exec:
concurrency: 1
Expand All @@ -71,53 +71,54 @@ scripts:

# dependsOn で or 条件で指定することができないため
# スクリプトを Flutter と Dart に分けている
report_test:
report:test:
steps:
- report_test_flutter
- report_test_dart
- report:test:flutter
- report:test:dart

report_test_flutter:
report:test:flutter:
run: flutter test --no-pub --machine > test_report.log
exec:
concurrency: 1
packageFilters:
dependsOn: flutter_test
dirExists: test

report_test_dart:
report:test:dart:
run: dart test --file-reporter="json:test_report.log"
exec:
concurrency: 1
packageFilters:
dependsOn: test
dirExists: test

# @deprecated `melos format` で代用可能
# ローカルでフォーマットとdart fix --applyを実行する
format_and_fix:
exec: bash "$MELOS_ROOT_PATH/scripts/format.sh"
Comment on lines +95 to 98
Copy link
Member Author

Choose a reason for hiding this comment

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

memo-badge

melos のバージョンがあがったことにより、独自で定義しなくても良くなった認識です。
#350 にて対応予定です。

Copy link
Member

@blendthink blendthink Jan 5, 2025

Choose a reason for hiding this comment

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

nits-badge
対象ファイルから自動生成ファイルを除外するようにしていたり、dart fix を実行していたりしていたので、完全に代用するのはできないと思います、、!

Copy link
Member Author

Choose a reason for hiding this comment

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

ありがとうございます!
おっしゃるとおり、完全な代替ではないですね…!

ask-badge

そもそもの?疑問になってしまうのですが、#219 にて CI で利用されていたこのスクリプトを melos format コマンド側に置き換えているみたいで、こちらのスクリプトはまだ必要そうなのかが少し悩ましいかもです…?
個人的には format については melos format に任せてしまって、fix 系のスクリプトを別途用意するほうがきれいかなと思ったりしています 👀

Copy link
Member

Choose a reason for hiding this comment

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

個人的には format については melos format に任せてしまって、fix 系のスクリプトを別途用意するほうがきれいかなと思ったりしています 👀

LGTM です!


report_custom_lint:ci:
ci:report:custom_lint:
exec: bash "$MELOS_ROOT_PATH/scripts/report-custom-lint-ci.sh"
packageFilters:
dependsOn: custom_lint

regenerate_code: melos run regenerate_by_using_gen_l10n && melos run regenerate_by_using_build_runner
gen: melos run gen:l10n && melos run gen:build
Copy link
Member Author

Choose a reason for hiding this comment

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

memo-badge

steps への変更などは #350 にて実施予定です。


regenerate_by_using_build_runner:
gen:build:
run: dart run build_runner build -d
exec:
orderDependents: true
packageFilters:
dependsOn: build_runner

regenerate_by_using_gen_l10n:
gen:l10n:
run: flutter gen-l10n
exec:
orderDependents: true
packageFilters:
dependsOn: flutter_localizations

yumemi_lints_update:
update:yumemi_lints:
exec: dart run yumemi_lints update
packageFilters:
dependsOn: yumemi_lints
Expand Down