diff --git a/.github/workflows/maestro_cli-prepare.yaml b/.github/workflows/maestro_cli-prepare.yaml index d1ff3e5be..3b4ffeffd 100644 --- a/.github/workflows/maestro_cli-prepare.yaml +++ b/.github/workflows/maestro_cli-prepare.yaml @@ -6,8 +6,14 @@ on: jobs: main: + name: Dart ${{ matrix.sdk }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sdk: [2.16.2, stable] + defaults: run: working-directory: packages/maestro_cli @@ -19,7 +25,7 @@ jobs: - name: Install Dart uses: dart-lang/setup-dart@v1.3 with: - sdk: stable + sdk: ${{ matrix.sdk }} - name: dart version run: dart --version diff --git a/.github/workflows/maestro_cli-publish.yaml b/.github/workflows/maestro_cli-publish.yaml index 581d30f93..98b2770a0 100644 --- a/.github/workflows/maestro_cli-publish.yaml +++ b/.github/workflows/maestro_cli-publish.yaml @@ -5,6 +5,16 @@ on: tags: ["maestro_cli-v*"] jobs: + check_versions: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Check if versions are defined consistently + run: ./check_versions + publish_cli: runs-on: ubuntu-latest @@ -19,7 +29,7 @@ jobs: - name: Setup Dart uses: dart-lang/setup-dart@v1 with: - sdk: 2.17.0 + sdk: stable - name: Download pub.dev credentials env: @@ -100,5 +110,5 @@ jobs: AZURE_STORAGE_URL: https://lncdmaestrostorage.blob.core.windows.net/artifacts AZURE_SAS_TOKEN: ${{ secrets.AZURE_SAS_TOKEN }} run: | - ./deploy ${{ env.SERVER_FILE }} - ./deploy ${{ env.INSTRUMENTATION_FILE }} + ./upload_artifact ${{ env.SERVER_FILE }} + ./upload_artifact ${{ env.INSTRUMENTATION_FILE }} diff --git a/.github/workflows/maestro_test-prepare.yaml b/.github/workflows/maestro_test-prepare.yaml index af23a0bae..7227d9625 100644 --- a/.github/workflows/maestro_test-prepare.yaml +++ b/.github/workflows/maestro_test-prepare.yaml @@ -6,8 +6,17 @@ on: jobs: main: + name: Flutter ${{ matrix.channel }}${{ matrix.version }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - version: 2.10.5 + - channel: stable + - channel: beta + defaults: run: working-directory: packages/maestro_test @@ -18,6 +27,9 @@ jobs: - name: Install Flutter uses: subosito/flutter-action@v1 + with: + channel: ${{ matrix.channel }} + flutter-version: ${{ matrix.version }} - name: Cache pub dependencies uses: actions/cache@v2 @@ -39,5 +51,18 @@ jobs: # - name: flutter test # run: flutter test - - name: flutter format + - name: flutter format (example app) + working-directory: ./packages/maestro_test/example + run: flutter format --set-exit-if-changed . + + - name: flutter pub get (example app) + working-directory: ./packages/maestro_test/example + run: flutter pub get + + - name: flutter analyze (example app) + working-directory: ./packages/maestro_test/example + run: flutter analyze --no-fatal-infos + + - name: flutter format (example app) + working-directory: ./packages/maestro_test/example run: flutter format --set-exit-if-changed . diff --git a/AutomatorServer/app/build.gradle b/AutomatorServer/app/build.gradle index 85cd8a299..e15d4a33d 100644 --- a/AutomatorServer/app/build.gradle +++ b/AutomatorServer/app/build.gradle @@ -13,7 +13,7 @@ android { minSdkVersion 26 targetSdkVersion 32 versionCode 1 - versionName "0.1.0" + versionName "0.1.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/AutomatorServer/deploy b/AutomatorServer/upload_artifact similarity index 92% rename from AutomatorServer/deploy rename to AutomatorServer/upload_artifact index 771a37323..2755c0957 100755 --- a/AutomatorServer/deploy +++ b/AutomatorServer/upload_artifact @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# deploy uploads a file to Azure Storage +# upload_artifact uploads a file to Azure Storage. artifact="${1:-}" diff --git a/README.md b/README.md index a7478b901..566f5d1db 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ git tag -a "maestro_cli-v0.0.4" -m "Release notes go here" [pub_link_test]: https://pub.dartlang.org/packages/maestro_test [pub_badge_cli]: https://img.shields.io/pub/v/maestro_cli?label=maestro_cli [pub_badge_style]: https://img.shields.io/badge/style-leancode__lint-black -[pub_badge_link]: https://pub.dartlang.org/packages/lean_code_lint +[pub_badge_link]: https://pub.dartlang.org/packages/leancode_lint [pub_link_cli]: https://pub.dartlang.org/packages/maestro_cli [ui_automator]: https://developer.android.com/training/testing/other-components/ui-automator [annotated_tag]: https://git-scm.com/book/en/v2/Git-Basics-Tagging#_annotated_tags diff --git a/check_versions b/check_versions new file mode 100755 index 000000000..bdaa99c64 --- /dev/null +++ b/check_versions @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +set -euo pipefail + +# check_versions checks whether the version of maestro_cli is defined +# consistently across all the places. Exits with code 0 if versions are +# consistent, exits with non-zero code otherwise. + +cd "$(dirname "$0")" || exit 2 + +declare -A versions + +checkPubspecVersion() { + path="./packages/maestro_cli/pubspec.yaml" + version=$(grep version "$path" | xargs | cut -d ' ' -f 2) + versions[pubspec]="$version" +} + +checkEmbeddedVersion() { + path="./packages/maestro_cli/lib/src/common/constants.dart" + version=$(grep 'const version' "$path" | cut -d\' -f 2) + versions[embedded]="$version" +} + +# checkChangelogVersion checks whether the first line of CHANGELOG.md contains a +# h2 element with the version. +checkChangelogVersion() { + path="./packages/maestro_cli/CHANGELOG.md" + version=$(head -n 1 $path | cut -d ' ' -f 2) + versions[changelog]="$version" +} + +checkApkVersion() { + path="./AutomatorServer/app/build.gradle" + version=$(grep versionName "$path" | xargs | cut -d ' ' -f 2) + versions[apk]="$version" +} + + +checkPubspecVersion +checkEmbeddedVersion +checkChangelogVersion +checkApkVersion + +exitCode=0 +previousValue="" +for version in "${!versions[@]}"; do + value="${versions[$version]}" + echo "$version: $value" + if [[ "$previousValue" ]] && [[ "$previousValue" != "$value" ]]; then + exitCode=1 + fi + previousValue="$value" +done + +exit "$exitCode" diff --git a/packages/maestro_cli/CHANGELOG.md b/packages/maestro_cli/CHANGELOG.md index 748cbe967..5238be71b 100644 --- a/packages/maestro_cli/CHANGELOG.md +++ b/packages/maestro_cli/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.1 + +- Set minimum Dart version to 2.16. +- Fix links to `package:leancode_lint` in README + ## 0.1.0 - Add `--template` option for `maestro bootstrap` diff --git a/packages/maestro_cli/README.md b/packages/maestro_cli/README.md index 7f6e4bff3..f8851dad5 100644 --- a/packages/maestro_cli/README.md +++ b/packages/maestro_cli/README.md @@ -1,7 +1,7 @@ # maestro_cli -[![maestro_cli on pub.dev][pub_badge]][pub_link] -[![code style][pub_badge_style]][pub_badge_link] +[![maestro_cli on pub.dev][pub_badge]][pub_link] [![code +style][pub_badge_style]][pub_badge_link] Command-line tool to make working with [maestro_test][pub_link_test] easier. @@ -63,4 +63,4 @@ Run `maestro bootstrap` to automatically do 1, 2, 3, 4, and most of 5. [pub_badge]: https://img.shields.io/pub/v/maestro_cli.svg [pub_link]: https://pub.dartlang.org/packages/maestro_cli [pub_badge_style]: https://img.shields.io/badge/style-leancode__lint-black -[pub_badge_link]: https://pub.dartlang.org/packages/lean_code_lint +[pub_badge_link]: https://pub.dartlang.org/packages/leancode_lint diff --git a/packages/maestro_cli/lib/src/common/constants.dart b/packages/maestro_cli/lib/src/common/constants.dart index 037d63f29..f254f0fb8 100644 --- a/packages/maestro_cli/lib/src/common/constants.dart +++ b/packages/maestro_cli/lib/src/common/constants.dart @@ -1,5 +1,5 @@ /// Version of Maestro CLI. Must be kept in sync with pubspec.yaml. -const version = '0.1.0'; +const version = '0.1.1'; const maestroPackage = 'maestro_test'; const maestroCliPackage = 'maestro_cli'; diff --git a/packages/maestro_cli/lib/src/common/logging.dart b/packages/maestro_cli/lib/src/common/logging.dart index 0f09e8e02..faf6f15bd 100644 --- a/packages/maestro_cli/lib/src/common/logging.dart +++ b/packages/maestro_cli/lib/src/common/logging.dart @@ -14,7 +14,7 @@ final log = Logger(''); extension LoggerX on Logger { /// Writes progress message to stdout. mason_logger.Progress progress(String message) { - return mason_logger.Progress(message, stdout); + return mason_logger.Progress(message, stdout, stderr); } } diff --git a/packages/maestro_cli/lib/src/features/bootstrap/bootstrap_command.dart b/packages/maestro_cli/lib/src/features/bootstrap/bootstrap_command.dart index b53367f0a..dea0f82b7 100644 --- a/packages/maestro_cli/lib/src/features/bootstrap/bootstrap_command.dart +++ b/packages/maestro_cli/lib/src/features/bootstrap/bootstrap_command.dart @@ -1,9 +1,9 @@ import 'dart:io'; import 'package:args/command_runner.dart'; -import 'package:maestro_cli/src/features/bootstrap/app_test_template.dart'; import 'package:maestro_cli/src/common/common.dart'; import 'package:maestro_cli/src/external/pubspec.dart' as pubspec; +import 'package:maestro_cli/src/features/bootstrap/app_test_template.dart'; import 'package:maestro_cli/src/maestro_config.dart'; import 'package:path/path.dart' as path; diff --git a/packages/maestro_cli/pubspec.lock b/packages/maestro_cli/pubspec.lock index 357b1bf46..17a893d0f 100644 --- a/packages/maestro_cli/pubspec.lock +++ b/packages/maestro_cli/pubspec.lock @@ -161,7 +161,7 @@ packages: name: mason_logger url: "https://pub.dartlang.org" source: hosted - version: "0.1.0-dev.10" + version: "0.1.0-dev.11" matcher: dependency: transitive description: @@ -210,7 +210,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "4.4.0" pool: dependency: transitive description: @@ -225,6 +225,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" shelf: dependency: transitive description: @@ -329,7 +336,7 @@ packages: name: toml url: "https://pub.dartlang.org" source: hosted - version: "0.13.1" + version: "0.12.0" typed_data: dependency: transitive description: diff --git a/packages/maestro_cli/pubspec.yaml b/packages/maestro_cli/pubspec.yaml index 7fbfb3906..c0608485b 100644 --- a/packages/maestro_cli/pubspec.yaml +++ b/packages/maestro_cli/pubspec.yaml @@ -1,10 +1,10 @@ name: maestro_cli description: CLI for Maestro. -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/leancodepl/maestro environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=2.16.0 <3.0.0" dependencies: ansi_styles: ^0.3.2+1 @@ -13,10 +13,10 @@ dependencies: logging: ^1.0.2 mason_logger: ^0.1.0-dev.10 path: ^1.8.2 - toml: ^0.13.1 + toml: ^0.12.0 yaml: ^3.1.1 dev_dependencies: - leancode_lint: ^1.2.1 + leancode_lint: ^1.1.0 test: ^1.21.1 executables: diff --git a/packages/maestro_test/CHANGELOG.md b/packages/maestro_test/CHANGELOG.md index 8e3383b81..f783a1431 100644 --- a/packages/maestro_test/CHANGELOG.md +++ b/packages/maestro_test/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.0.6 + +- Set minimum Dart version to 2.16. +- Fix links to `package:leancode_lint` in README + ## 0.0.5 - Update broken link in README. diff --git a/packages/maestro_test/README.md b/packages/maestro_test/README.md index 0d0a12823..bca7c8772 100644 --- a/packages/maestro_test/README.md +++ b/packages/maestro_test/README.md @@ -65,5 +65,5 @@ void main() { [pub_badge]: https://img.shields.io/pub/v/maestro_test.svg [pub_link]: https://pub.dartlang.org/packages/maestro_test [pub_badge_style]: https://img.shields.io/badge/style-leancode__lint-black -[pub_badge_link]: https://pub.dartlang.org/packages/lean_code_lint +[pub_badge_link]: https://pub.dartlang.org/packages/leancode_lint [ui_automator]: https://developer.android.com/training/testing/other-components/ui-automator diff --git a/packages/maestro_test/example/pubspec.yaml b/packages/maestro_test/example/pubspec.yaml index a77c50da3..99dcc339e 100644 --- a/packages/maestro_test/example/pubspec.yaml +++ b/packages/maestro_test/example/pubspec.yaml @@ -4,10 +4,10 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=2.16.2 <3.0.0" + sdk: ">=2.16.0 <3.0.0" dependencies: - cupertino_icons: ^1.0.4 + cupertino_icons: ^1.0.5 flutter: sdk: flutter @@ -16,7 +16,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - leancode_lint: ^1.2.1 + leancode_lint: ^1.1.0 maestro_test: path: ../ diff --git a/packages/maestro_test/pubspec.yaml b/packages/maestro_test/pubspec.yaml index 0881bed98..023c57131 100644 --- a/packages/maestro_test/pubspec.yaml +++ b/packages/maestro_test/pubspec.yaml @@ -2,16 +2,16 @@ name: maestro_test description: > Simple, easy-to-learn, Flutter-native UI testing framework eliminating limitations of flutter_driver -version: 0.0.5 +version: 0.0.6 homepage: https://github.com/leancodepl/maestro environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=2.16.0 <3.0.0" dependencies: http: ^0.13.4 logging: ^1.0.2 dev_dependencies: - leancode_lint: ^1.2.1 + leancode_lint: ^1.1.0 test: ^1.21.1