Skip to content

Commit

Permalink
Review nit, fix analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Dec 18, 2024
1 parent ba9a854 commit 77e79ba
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 102 deletions.
101 changes: 8 additions & 93 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,47 +340,7 @@ jobs:
- job_004
- job_005
job_010:
name: "generate_and_analyze; Dart dev; PKG: web_generator; `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator;commands:analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator
os:ubuntu-latest;pub-cache-hosted;sdk:dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: web_generator_pub_upgrade
name: web_generator; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: web_generator
- name: "web_generator; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'"
working-directory: web_generator
needs:
- job_001
- job_002
- job_003
- job_004
- job_005
- job_006
- job_007
- job_008
- job_009
job_011:
name: "generate_and_analyze; Dart dev; PKG: web_generator; `dart pub -C ../web get; dart bin/update_bindings.dart`"
name: "generate_and_analyze; Dart dev; PKG: web_generator; `dart pub -C ../web get && dart bin/update_bindings.dart && dart analyze --fatal-infos ../web`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
Expand All @@ -405,8 +365,8 @@ jobs:
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: web_generator
- name: "web_generator; dart pub -C ../web get; dart bin/update_bindings.dart"
run: "dart pub -C ../web get; dart bin/update_bindings.dart"
- name: "web_generator; dart pub -C ../web get && dart bin/update_bindings.dart && dart analyze --fatal-infos ../web"
run: "dart pub -C ../web get && dart bin/update_bindings.dart && dart analyze --fatal-infos ../web"
if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'"
working-directory: web_generator
needs:
Expand All @@ -419,50 +379,8 @@ jobs:
- job_007
- job_008
- job_009
job_012:
name: "generate_all_and_analyze; Dart dev; PKG: web_generator; `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator;commands:analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator
os:ubuntu-latest;pub-cache-hosted;sdk:dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: web_generator_pub_upgrade
name: web_generator; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: web_generator
- name: "web_generator; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'"
working-directory: web_generator
needs:
- job_001
- job_002
- job_003
- job_004
- job_005
- job_006
- job_007
- job_008
- job_009
- job_010
- job_011
job_013:
name: "generate_all_and_analyze; Dart dev; PKG: web_generator; `dart pub -C ../web get; dart bin/update_bindings.dart --generate-all`"
job_011:
name: "generate_all_and_analyze; Dart dev; PKG: web_generator; `dart pub -C ../web get && dart bin/update_bindings.dart --generate-all && dart analyze --fatal-infos ../web`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
Expand All @@ -487,8 +405,8 @@ jobs:
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: web_generator
- name: "web_generator; dart pub -C ../web get; dart bin/update_bindings.dart --generate-all"
run: "dart pub -C ../web get; dart bin/update_bindings.dart --generate-all"
- name: "web_generator; dart pub -C ../web get && dart bin/update_bindings.dart --generate-all && dart analyze --fatal-infos ../web"
run: "dart pub -C ../web get && dart bin/update_bindings.dart --generate-all && dart analyze --fatal-infos ../web"
if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'"
working-directory: web_generator
needs:
Expand All @@ -502,8 +420,7 @@ jobs:
- job_008
- job_009
- job_010
- job_011
job_014:
job_012:
name: "dart_fixes; Dart main; PKG: web; `dart fix --compare-to-golden test_fixes`"
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -545,5 +462,3 @@ jobs:
- job_009
- job_010
- job_011
- job_012
- job_013
8 changes: 4 additions & 4 deletions tool/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ for PKG in ${PKGS}; do
dart fix --compare-to-golden test_fixes || EXIT_CODE=$?
;;
command_1)
echo 'dart pub -C ../web get; dart bin/update_bindings.dart'
dart pub -C ../web get; dart bin/update_bindings.dart || EXIT_CODE=$?
echo 'dart pub -C ../web get && dart bin/update_bindings.dart && dart analyze --fatal-infos ../web'
dart pub -C ../web get && dart bin/update_bindings.dart && dart analyze --fatal-infos ../web || EXIT_CODE=$?
;;
command_2)
echo 'dart pub -C ../web get; dart bin/update_bindings.dart --generate-all'
dart pub -C ../web get; dart bin/update_bindings.dart --generate-all || EXIT_CODE=$?
echo 'dart pub -C ../web get && dart bin/update_bindings.dart --generate-all && dart analyze --fatal-infos ../web'
dart pub -C ../web get && dart bin/update_bindings.dart --generate-all && dart analyze --fatal-infos ../web || EXIT_CODE=$?
;;
format)
echo 'dart format --output=none --set-exit-if-changed .'
Expand Down
2 changes: 1 addition & 1 deletion web_generator/lib/src/dart_main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'util.dart';

void main(List<String> args) async {
var languageVersionString = const String.fromEnvironment('languageVersion');
if (languageVersionString == '') {
if (languageVersionString.isEmpty) {
languageVersionString = DartFormatter.latestLanguageVersion.toString();
}
final ArgResults argResult;
Expand Down
12 changes: 8 additions & 4 deletions web_generator/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ stages:
- test: --test-randomize-ordering-seed=random -p chrome
- test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm
- generate_and_analyze:
- command: dart pub -C ../web get; dart bin/update_bindings.dart
- analyze: --fatal-infos .
- command:
- dart pub -C ../web get
- dart bin/update_bindings.dart
- dart analyze --fatal-infos ../web
- generate_all_and_analyze:
- command: dart pub -C ../web get; dart bin/update_bindings.dart --generate-all
- analyze: --fatal-infos .
- command:
- dart pub -C ../web get
- dart bin/update_bindings.dart --generate-all
- dart analyze --fatal-infos ../web

0 comments on commit 77e79ba

Please sign in to comment.