From 02ed7aa02ce7fa304b7d5b40eb93b672f46cad63 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Mon, 19 Sep 2022 18:11:48 -0700 Subject: [PATCH] CI: only do a regular analyze check on non-dev SDKs --- .github/workflows/dart.yml | 78 +++++++----------------- _test/mono_pkg.yaml | 8 +-- _test_package/mono_pkg.yaml | 4 ++ discoveryapis_commons/mono_pkg.yaml | 4 ++ discoveryapis_generator/mono_pkg.yaml | 4 ++ generated/googleapis/mono_pkg.yaml | 4 ++ generated/googleapis_beta/mono_pkg.yaml | 4 ++ generator/mono_pkg.yaml | 8 +-- googleapis_auth/mono_pkg.yaml | 4 ++ resources/googleapis/_mono_pkg.yaml | 4 ++ resources/googleapis_beta/_mono_pkg.yaml | 4 ++ resources/test_pkg_mono_pkg.yaml | 4 ++ test_integration/mono_pkg.yaml | 8 +-- tool/ci.sh | 6 +- 14 files changed, 74 insertions(+), 70 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 7d252ca8e..118dcb076 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -40,14 +40,14 @@ jobs: - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: - name: "analyze_and_format; Dart 2.17.0; PKGS: _test, _test_package, discoveryapis_commons, discoveryapis_generator, generated/googleapis, generated/googleapis_beta, generator, googleapis_auth, test_integration; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`" + name: "analyze_and_format; Dart 2.17.0; PKGS: _test, _test_package, discoveryapis_commons, discoveryapis_generator, generated/googleapis, generated/googleapis_beta, generator, googleapis_auth, test_integration; `dart analyze`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0;packages:_test-_test_package-discoveryapis_commons-discoveryapis_generator-generated/googleapis-generated/googleapis_beta-generator-googleapis_auth-test_integration;commands:format-analyze" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0;packages:_test-_test_package-discoveryapis_commons-discoveryapis_generator-generated/googleapis-generated/googleapis_beta-generator-googleapis_auth-test_integration;commands:analyze_1" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0;packages:_test-_test_package-discoveryapis_commons-discoveryapis_generator-generated/googleapis-generated/googleapis_beta-generator-googleapis_auth-test_integration os:ubuntu-latest;pub-cache-hosted;sdk:2.17.0 @@ -65,12 +65,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: _test - - name: "_test; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps._test_pub_upgrade.conclusion == 'success'" - working-directory: _test - - name: "_test; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . + - name: _test; dart analyze + run: dart analyze if: "always() && steps._test_pub_upgrade.conclusion == 'success'" working-directory: _test - id: _test_package_pub_upgrade @@ -78,12 +74,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: _test_package - - name: "_test_package; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps._test_package_pub_upgrade.conclusion == 'success'" - working-directory: _test_package - - name: "_test_package; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . + - name: _test_package; dart analyze + run: dart analyze if: "always() && steps._test_package_pub_upgrade.conclusion == 'success'" working-directory: _test_package - id: discoveryapis_commons_pub_upgrade @@ -91,12 +83,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: discoveryapis_commons - - name: "discoveryapis_commons; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps.discoveryapis_commons_pub_upgrade.conclusion == 'success'" - working-directory: discoveryapis_commons - - name: "discoveryapis_commons; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . + - name: discoveryapis_commons; dart analyze + run: dart analyze if: "always() && steps.discoveryapis_commons_pub_upgrade.conclusion == 'success'" working-directory: discoveryapis_commons - id: discoveryapis_generator_pub_upgrade @@ -104,12 +92,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: discoveryapis_generator - - name: "discoveryapis_generator; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps.discoveryapis_generator_pub_upgrade.conclusion == 'success'" - working-directory: discoveryapis_generator - - name: "discoveryapis_generator; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . + - name: discoveryapis_generator; dart analyze + run: dart analyze if: "always() && steps.discoveryapis_generator_pub_upgrade.conclusion == 'success'" working-directory: discoveryapis_generator - id: generated_googleapis_pub_upgrade @@ -117,12 +101,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: generated/googleapis - - name: "generated/googleapis; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps.generated_googleapis_pub_upgrade.conclusion == 'success'" - working-directory: generated/googleapis - - name: "generated/googleapis; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . + - name: generated/googleapis; dart analyze + run: dart analyze if: "always() && steps.generated_googleapis_pub_upgrade.conclusion == 'success'" working-directory: generated/googleapis - id: generated_googleapis_beta_pub_upgrade @@ -130,12 +110,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: generated/googleapis_beta - - name: "generated/googleapis_beta; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps.generated_googleapis_beta_pub_upgrade.conclusion == 'success'" - working-directory: generated/googleapis_beta - - name: "generated/googleapis_beta; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . + - name: generated/googleapis_beta; dart analyze + run: dart analyze if: "always() && steps.generated_googleapis_beta_pub_upgrade.conclusion == 'success'" working-directory: generated/googleapis_beta - id: generator_pub_upgrade @@ -143,12 +119,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: generator - - name: "generator; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps.generator_pub_upgrade.conclusion == 'success'" - working-directory: generator - - name: "generator; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . + - name: generator; dart analyze + run: dart analyze if: "always() && steps.generator_pub_upgrade.conclusion == 'success'" working-directory: generator - id: googleapis_auth_pub_upgrade @@ -156,12 +128,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: googleapis_auth - - name: "googleapis_auth; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps.googleapis_auth_pub_upgrade.conclusion == 'success'" - working-directory: googleapis_auth - - name: "googleapis_auth; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . + - name: googleapis_auth; dart analyze + run: dart analyze if: "always() && steps.googleapis_auth_pub_upgrade.conclusion == 'success'" working-directory: googleapis_auth - id: test_integration_pub_upgrade @@ -169,12 +137,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: test_integration - - name: "test_integration; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps.test_integration_pub_upgrade.conclusion == 'success'" - working-directory: test_integration - - name: "test_integration; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . + - name: test_integration; dart analyze + run: dart analyze if: "always() && steps.test_integration_pub_upgrade.conclusion == 'success'" working-directory: test_integration job_003: @@ -185,7 +149,7 @@ jobs: uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test-_test_package-discoveryapis_commons-discoveryapis_generator-generated/googleapis-generated/googleapis_beta-generator-googleapis_auth-test_integration;commands:format-analyze" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test-_test_package-discoveryapis_commons-discoveryapis_generator-generated/googleapis-generated/googleapis_beta-generator-googleapis_auth-test_integration;commands:format-analyze_0" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test-_test_package-discoveryapis_commons-discoveryapis_generator-generated/googleapis-generated/googleapis_beta-generator-googleapis_auth-test_integration os:ubuntu-latest;pub-cache-hosted;sdk:dev diff --git a/_test/mono_pkg.yaml b/_test/mono_pkg.yaml index 13942e4c2..1101d17b1 100644 --- a/_test/mono_pkg.yaml +++ b/_test/mono_pkg.yaml @@ -1,9 +1,9 @@ -sdk: -- pubspec -- dev - stages: - analyze_and_format: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec diff --git a/_test_package/mono_pkg.yaml b/_test_package/mono_pkg.yaml index b44b90b9d..eaba470e9 100644 --- a/_test_package/mono_pkg.yaml +++ b/_test_package/mono_pkg.yaml @@ -8,5 +8,9 @@ stages: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec - unittest: - test: diff --git a/discoveryapis_commons/mono_pkg.yaml b/discoveryapis_commons/mono_pkg.yaml index b44b90b9d..eaba470e9 100644 --- a/discoveryapis_commons/mono_pkg.yaml +++ b/discoveryapis_commons/mono_pkg.yaml @@ -8,5 +8,9 @@ stages: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec - unittest: - test: diff --git a/discoveryapis_generator/mono_pkg.yaml b/discoveryapis_generator/mono_pkg.yaml index b44b90b9d..eaba470e9 100644 --- a/discoveryapis_generator/mono_pkg.yaml +++ b/discoveryapis_generator/mono_pkg.yaml @@ -8,5 +8,9 @@ stages: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec - unittest: - test: diff --git a/generated/googleapis/mono_pkg.yaml b/generated/googleapis/mono_pkg.yaml index b44b90b9d..eaba470e9 100644 --- a/generated/googleapis/mono_pkg.yaml +++ b/generated/googleapis/mono_pkg.yaml @@ -8,5 +8,9 @@ stages: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec - unittest: - test: diff --git a/generated/googleapis_beta/mono_pkg.yaml b/generated/googleapis_beta/mono_pkg.yaml index b44b90b9d..eaba470e9 100644 --- a/generated/googleapis_beta/mono_pkg.yaml +++ b/generated/googleapis_beta/mono_pkg.yaml @@ -8,5 +8,9 @@ stages: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec - unittest: - test: diff --git a/generator/mono_pkg.yaml b/generator/mono_pkg.yaml index b148217dd..6265a357a 100644 --- a/generator/mono_pkg.yaml +++ b/generator/mono_pkg.yaml @@ -1,10 +1,10 @@ # See https://pub.dev/packages/mono_repo -sdk: -- pubspec -- dev - stages: - analyze_and_format: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec diff --git a/googleapis_auth/mono_pkg.yaml b/googleapis_auth/mono_pkg.yaml index 329934210..444b6208a 100644 --- a/googleapis_auth/mono_pkg.yaml +++ b/googleapis_auth/mono_pkg.yaml @@ -8,6 +8,10 @@ stages: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec - unittest: - test: -p vm - test: -p chrome diff --git a/resources/googleapis/_mono_pkg.yaml b/resources/googleapis/_mono_pkg.yaml index b44b90b9d..eaba470e9 100644 --- a/resources/googleapis/_mono_pkg.yaml +++ b/resources/googleapis/_mono_pkg.yaml @@ -8,5 +8,9 @@ stages: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec - unittest: - test: diff --git a/resources/googleapis_beta/_mono_pkg.yaml b/resources/googleapis_beta/_mono_pkg.yaml index b44b90b9d..eaba470e9 100644 --- a/resources/googleapis_beta/_mono_pkg.yaml +++ b/resources/googleapis_beta/_mono_pkg.yaml @@ -8,5 +8,9 @@ stages: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec - unittest: - test: diff --git a/resources/test_pkg_mono_pkg.yaml b/resources/test_pkg_mono_pkg.yaml index b44b90b9d..eaba470e9 100644 --- a/resources/test_pkg_mono_pkg.yaml +++ b/resources/test_pkg_mono_pkg.yaml @@ -8,5 +8,9 @@ stages: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec - unittest: - test: diff --git a/test_integration/mono_pkg.yaml b/test_integration/mono_pkg.yaml index 35d155060..6cd780c48 100644 --- a/test_integration/mono_pkg.yaml +++ b/test_integration/mono_pkg.yaml @@ -1,13 +1,13 @@ # See https://pub.dev/packages/mono_repo -sdk: -- pubspec -- dev - stages: - analyze_and_format: - group: - format - analyze: --fatal-infos . + sdk: dev + - group: + - analyze + sdk: pubspec # Need to wire up Google auth on CI before we can test this on...CI #- unittest: # - test: diff --git a/tool/ci.sh b/tool/ci.sh index 2cc140829..f76f4517f 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -67,10 +67,14 @@ for PKG in ${PKGS}; do echo echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m" case ${TASK} in - analyze) + analyze_0) echo 'dart analyze --fatal-infos .' dart analyze --fatal-infos . || EXIT_CODE=$? ;; + analyze_1) + echo 'dart analyze' + dart analyze || EXIT_CODE=$? + ;; format) echo 'dart format --output=none --set-exit-if-changed .' dart format --output=none --set-exit-if-changed . || EXIT_CODE=$?