Update CI with mono_repo 5.0 (#518)
diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml
index 6642e89..b94d02c 100644
--- a/.github/workflows/dart.yml
+++ b/.github/workflows/dart.yml
@@ -1,4 +1,4 @@
-# Created with package:mono_repo v4.1.0
+# Created with package:mono_repo v5.0.0
name: Dart CI
on:
push:
@@ -26,7 +26,7 @@
uses: actions/cache@v2.1.6
with:
path: "~/.pub-cache/hosted"
- key: "os:ubuntu-latest;pub-cache-hosted;dart:2.10.5;packages:protobuf;commands:dartanalyzer_3-dartanalyzer_4"
+ key: "os:ubuntu-latest;pub-cache-hosted;dart:2.10.5;packages:protobuf;commands:analyze_3-analyze_4"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;dart:2.10.5;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;dart:2.10.5
@@ -38,10 +38,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protobuf_pub_upgrade
- name: protobuf; pub upgrade
+ name: protobuf; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protobuf
- run: pub upgrade
+ run: dart pub upgrade
- name: protobuf; dart analyze lib
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
@@ -58,7 +58,7 @@
uses: actions/cache@v2.1.6
with:
path: "~/.pub-cache/hosted"
- key: "os:ubuntu-latest;pub-cache-hosted;dart:2.10.5;packages:protoc_plugin;commands:command_0-command_2-dartanalyzer_0"
+ key: "os:ubuntu-latest;pub-cache-hosted;dart:2.10.5;packages:protoc_plugin;commands:command_0-command_2-analyze_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;dart:2.10.5;packages:protoc_plugin
os:ubuntu-latest;pub-cache-hosted;dart:2.10.5
@@ -70,10 +70,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protoc_plugin_pub_upgrade
- name: protoc_plugin; pub upgrade
+ name: protoc_plugin; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protoc_plugin
- run: pub upgrade
+ run: dart pub upgrade
- name: protoc_plugin; ./../tool/setup.sh
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
@@ -94,7 +94,7 @@
uses: actions/cache@v2.1.6
with:
path: "~/.pub-cache/hosted"
- key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:api_benchmark-query_benchmark;commands:command_0-command_1-dartfmt-dartanalyzer_0"
+ key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:api_benchmark-query_benchmark;commands:command_0-command_1-format-analyze_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:api_benchmark-query_benchmark
os:ubuntu-latest;pub-cache-hosted;dart:dev
@@ -106,10 +106,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: api_benchmark_pub_upgrade
- name: api_benchmark; pub upgrade
+ name: api_benchmark; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: api_benchmark
- run: pub upgrade
+ run: dart pub upgrade
- name: api_benchmark; ./../tool/setup.sh
if: "always() && steps.api_benchmark_pub_upgrade.conclusion == 'success'"
working-directory: api_benchmark
@@ -127,10 +127,10 @@
working-directory: api_benchmark
run: dart analyze
- id: query_benchmark_pub_upgrade
- name: query_benchmark; pub upgrade
+ name: query_benchmark; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: query_benchmark
- run: pub upgrade
+ run: dart pub upgrade
- name: query_benchmark; ./../tool/setup.sh
if: "always() && steps.query_benchmark_pub_upgrade.conclusion == 'success'"
working-directory: query_benchmark
@@ -155,7 +155,7 @@
uses: actions/cache@v2.1.6
with:
path: "~/.pub-cache/hosted"
- key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:protobuf;commands:dartfmt-dartanalyzer_1-dartanalyzer_2"
+ key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:protobuf;commands:format-analyze_1-analyze_2"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;dart:dev
@@ -167,10 +167,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protobuf_pub_upgrade
- name: protobuf; pub upgrade
+ name: protobuf; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protobuf
- run: pub upgrade
+ run: dart pub upgrade
- name: "protobuf; dart format --output=none --set-exit-if-changed ."
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
@@ -191,7 +191,7 @@
uses: actions/cache@v2.1.6
with:
path: "~/.pub-cache/hosted"
- key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:protoc_plugin;commands:command_0-command_2-dartfmt-dartanalyzer_5"
+ key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:protoc_plugin;commands:command_0-command_2-format-analyze_5"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:protoc_plugin
os:ubuntu-latest;pub-cache-hosted;dart:dev
@@ -203,10 +203,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protoc_plugin_pub_upgrade
- name: protoc_plugin; pub upgrade
+ name: protoc_plugin; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protoc_plugin
- run: pub upgrade
+ run: dart pub upgrade
- name: protoc_plugin; ./../tool/setup.sh
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
@@ -243,10 +243,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protobuf_pub_upgrade
- name: protobuf; pub upgrade
+ name: protobuf; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protobuf
- run: pub upgrade
+ run: dart pub upgrade
- name: protobuf; dart test
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
@@ -277,10 +277,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protoc_plugin_pub_upgrade
- name: protoc_plugin; pub upgrade
+ name: protoc_plugin; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protoc_plugin
- run: pub upgrade
+ run: dart pub upgrade
- name: protoc_plugin; ./../tool/setup.sh
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
@@ -319,10 +319,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protobuf_pub_upgrade
- name: protobuf; pub upgrade
+ name: protobuf; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protobuf
- run: pub upgrade
+ run: dart pub upgrade
- name: protobuf; dart test
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
@@ -353,10 +353,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protoc_plugin_pub_upgrade
- name: protoc_plugin; pub upgrade
+ name: protoc_plugin; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protoc_plugin
- run: pub upgrade
+ run: dart pub upgrade
- name: protoc_plugin; ./../tool/setup.sh
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
@@ -395,10 +395,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protobuf_pub_upgrade
- name: protobuf; pub upgrade
+ name: protobuf; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protobuf
- run: pub upgrade
+ run: dart pub upgrade
- name: protobuf; dart test
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
@@ -429,10 +429,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protobuf_pub_upgrade
- name: protobuf; pub upgrade
+ name: protobuf; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protobuf
- run: pub upgrade
+ run: dart pub upgrade
- name: protobuf; dart test
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
@@ -453,10 +453,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protobuf_pub_upgrade
- name: protobuf; pub.bat upgrade
+ name: protobuf; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protobuf
- run: pub.bat upgrade
+ run: dart pub upgrade
- name: protobuf; dart test
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
@@ -477,10 +477,10 @@
- id: checkout
uses: actions/checkout@v2.3.4
- id: protobuf_pub_upgrade
- name: protobuf; pub.bat upgrade
+ name: protobuf; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protobuf
- run: pub.bat upgrade
+ run: dart pub upgrade
- name: protobuf; dart test
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
diff --git a/api_benchmark/mono_pkg.yaml b/api_benchmark/mono_pkg.yaml
index 248b40f..3041c3f 100644
--- a/api_benchmark/mono_pkg.yaml
+++ b/api_benchmark/mono_pkg.yaml
@@ -5,6 +5,6 @@
- group:
- command: ./../tool/setup.sh
- command: ./compile_protos.sh
- - dartfmt
- - dartanalyzer
+ - format
+ - analyze
dart: [dev]
diff --git a/protobuf/mono_pkg.yaml b/protobuf/mono_pkg.yaml
index 954d62c..c3e79d2 100644
--- a/protobuf/mono_pkg.yaml
+++ b/protobuf/mono_pkg.yaml
@@ -7,13 +7,13 @@
stages:
- format_analyze:
- group:
- - dartfmt
- - dartanalyzer: --fatal-infos lib
- - dartanalyzer: --fatal-infos test
+ - format
+ - analyze: --fatal-infos lib
+ - analyze: --fatal-infos test
dart: [dev]
- group:
- - dartanalyzer: lib
- - dartanalyzer: test
+ - analyze: lib
+ - analyze: test
dart: [2.10.5]
- run_tests:
- group: [test]
diff --git a/protoc_plugin/mono_pkg.yaml b/protoc_plugin/mono_pkg.yaml
index eadf90f..6bafab2 100644
--- a/protoc_plugin/mono_pkg.yaml
+++ b/protoc_plugin/mono_pkg.yaml
@@ -4,13 +4,13 @@
- group:
- command: ./../tool/setup.sh
- command: make protos
- - dartfmt
- - dartanalyzer: --fatal-infos
+ - format
+ - analyze: --fatal-infos
dart: [dev]
- group:
- command: ./../tool/setup.sh
- command: make protos
- - dartanalyzer
+ - analyze
dart: [2.10.5]
- run_tests:
- group:
diff --git a/query_benchmark/mono_pkg.yaml b/query_benchmark/mono_pkg.yaml
index 248b40f..3041c3f 100644
--- a/query_benchmark/mono_pkg.yaml
+++ b/query_benchmark/mono_pkg.yaml
@@ -5,6 +5,6 @@
- group:
- command: ./../tool/setup.sh
- command: ./compile_protos.sh
- - dartfmt
- - dartanalyzer
+ - format
+ - analyze
dart: [dev]
diff --git a/tool/ci.sh b/tool/ci.sh
index bd52fea..8905177 100755
--- a/tool/ci.sh
+++ b/tool/ci.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Created with package:mono_repo v4.1.0
+# Created with package:mono_repo v5.0.0
# Support built in commands on windows out of the box.
# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
@@ -7,31 +7,29 @@
# This assumes that the Flutter SDK has been installed in a previous step.
function pub() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then
- command flutter.bat pub "$@"
- else
- command flutter pub "$@"
- fi
+ command flutter pub "$@"
else
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then
- command pub.bat "$@"
- else
- command dart pub "$@"
- fi
+ command dart pub "$@"
fi
}
-function dartfmt() {
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then
- command dartfmt.bat "$@"
+# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
+# then "flutter" is called instead of "pub".
+# This assumes that the Flutter SDK has been installed in a previous step.
+function format() {
+ if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
+ command flutter format "$@"
else
- command dartfmt "$@"
+ command dart format "$@"
fi
}
-function dartanalyzer() {
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then
- command dartanalyzer.bat "$@"
+# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
+# then "flutter" is called instead of "pub".
+# This assumes that the Flutter SDK has been installed in a previous step.
+function analyze() {
+ if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
+ command flutter analyze "$@"
else
- command dartanalyzer "$@"
+ command dart analyze "$@"
fi
}
@@ -69,6 +67,30 @@
echo
echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m"
case ${TASK} in
+ analyze_0)
+ echo 'dart analyze'
+ dart analyze || EXIT_CODE=$?
+ ;;
+ analyze_1)
+ echo 'dart analyze --fatal-infos lib'
+ dart analyze --fatal-infos lib || EXIT_CODE=$?
+ ;;
+ analyze_2)
+ echo 'dart analyze --fatal-infos test'
+ dart analyze --fatal-infos test || EXIT_CODE=$?
+ ;;
+ analyze_3)
+ echo 'dart analyze lib'
+ dart analyze lib || EXIT_CODE=$?
+ ;;
+ analyze_4)
+ echo 'dart analyze test'
+ dart analyze test || EXIT_CODE=$?
+ ;;
+ analyze_5)
+ echo 'dart analyze --fatal-infos'
+ dart analyze --fatal-infos || EXIT_CODE=$?
+ ;;
command_0)
echo './../tool/setup.sh'
./../tool/setup.sh || EXIT_CODE=$?
@@ -81,31 +103,7 @@
echo 'make protos'
make protos || EXIT_CODE=$?
;;
- dartanalyzer_0)
- echo 'dart analyze'
- dart analyze || EXIT_CODE=$?
- ;;
- dartanalyzer_1)
- echo 'dart analyze --fatal-infos lib'
- dart analyze --fatal-infos lib || EXIT_CODE=$?
- ;;
- dartanalyzer_2)
- echo 'dart analyze --fatal-infos test'
- dart analyze --fatal-infos test || EXIT_CODE=$?
- ;;
- dartanalyzer_3)
- echo 'dart analyze lib'
- dart analyze lib || EXIT_CODE=$?
- ;;
- dartanalyzer_4)
- echo 'dart analyze test'
- dart analyze test || EXIT_CODE=$?
- ;;
- dartanalyzer_5)
- echo 'dart analyze --fatal-infos'
- dart analyze --fatal-infos || EXIT_CODE=$?
- ;;
- dartfmt)
+ format)
echo 'dart format --output=none --set-exit-if-changed .'
dart format --output=none --set-exit-if-changed . || EXIT_CODE=$?
;;