From 1abef724d4bc3593b971faaf7eddb42f9c50ccf2 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Thu, 2 Nov 2023 08:42:07 -0700 Subject: [PATCH] Test on mac and windows --- .github/workflows/dart.yml | 76 +++++++++++++++++-------- pkgs/flutter_http_example/mono_pkg.yaml | 13 +++-- tool/ci.sh | 4 -- 3 files changed, 60 insertions(+), 33 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index e9e0a53ff1..979572a081 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -40,7 +40,7 @@ jobs: - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: - name: "analyze_and_format; Dart 2.19.0; PKG: pkgs/http_client_conformance_tests; `dart analyze --fatal-infos`" + name: "analyze_and_format; linux; Dart 2.19.0; PKG: pkgs/http_client_conformance_tests; `dart analyze --fatal-infos`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -70,7 +70,7 @@ jobs: if: "always() && steps.pkgs_http_client_conformance_tests_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http_client_conformance_tests job_003: - name: "analyze_and_format; Dart 3.0.0; PKG: pkgs/http; `dart analyze --fatal-infos`" + name: "analyze_and_format; linux; Dart 3.0.0; PKG: pkgs/http; `dart analyze --fatal-infos`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -100,7 +100,7 @@ jobs: if: "always() && steps.pkgs_http_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http job_004: - name: "analyze_and_format; Dart dev; PKGS: pkgs/http, pkgs/http_client_conformance_tests; `dart analyze --fatal-infos`" + name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/http, pkgs/http_client_conformance_tests; `dart analyze --fatal-infos`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -139,7 +139,7 @@ jobs: if: "always() && steps.pkgs_http_client_conformance_tests_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http_client_conformance_tests job_005: - name: "analyze_and_format; Dart dev; PKGS: pkgs/http, pkgs/http_client_conformance_tests; `dart format --output=none --set-exit-if-changed .`" + name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/http, pkgs/http_client_conformance_tests; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -178,7 +178,7 @@ jobs: if: "always() && steps.pkgs_http_client_conformance_tests_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http_client_conformance_tests job_006: - name: "analyze_and_format; Flutter stable; PKG: pkgs/flutter_http_example; `dart format --output=none --set-exit-if-changed .`" + name: "analyze_and_format; linux; Flutter stable; PKG: pkgs/flutter_http_example; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -208,7 +208,7 @@ jobs: if: "always() && steps.pkgs_flutter_http_example_pub_upgrade.conclusion == 'success'" working-directory: pkgs/flutter_http_example job_007: - name: "analyze_and_format; Flutter stable; PKG: pkgs/flutter_http_example; `flutter analyze --fatal-infos`" + name: "analyze_and_format; linux; Flutter stable; PKG: pkgs/flutter_http_example; `flutter analyze --fatal-infos`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -238,7 +238,7 @@ jobs: if: "always() && steps.pkgs_flutter_http_example_pub_upgrade.conclusion == 'success'" working-directory: pkgs/flutter_http_example job_008: - name: "unit_test; Dart 3.0.0; PKG: pkgs/http; `dart run --define=no_default_http_client=true test/no_default_http_client_test.dart`" + name: "unit_test; linux; Dart 3.0.0; PKG: pkgs/http; `dart run --define=no_default_http_client=true test/no_default_http_client_test.dart`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -276,7 +276,7 @@ jobs: - job_006 - job_007 job_009: - name: "unit_test; Dart 3.0.0; PKG: pkgs/http; `dart test --platform chrome`" + name: "unit_test; linux; Dart 3.0.0; PKG: pkgs/http; `dart test --platform chrome`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -314,7 +314,7 @@ jobs: - job_006 - job_007 job_010: - name: "unit_test; Dart 3.0.0; PKG: pkgs/http; `dart test --platform vm`" + name: "unit_test; linux; Dart 3.0.0; PKG: pkgs/http; `dart test --platform vm`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -352,7 +352,7 @@ jobs: - job_006 - job_007 job_011: - name: "unit_test; Dart dev; PKG: pkgs/http; `dart run --define=no_default_http_client=true test/no_default_http_client_test.dart`" + name: "unit_test; linux; Dart dev; PKG: pkgs/http; `dart run --define=no_default_http_client=true test/no_default_http_client_test.dart`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -390,7 +390,7 @@ jobs: - job_006 - job_007 job_012: - name: "unit_test; Dart dev; PKG: pkgs/http; `dart test --platform chrome`" + name: "unit_test; linux; Dart dev; PKG: pkgs/http; `dart test --platform chrome`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -428,7 +428,7 @@ jobs: - job_006 - job_007 job_013: - name: "unit_test; Dart dev; PKG: pkgs/http; `dart test --platform vm`" + name: "unit_test; linux; Dart dev; PKG: pkgs/http; `dart test --platform vm`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -466,7 +466,7 @@ jobs: - job_006 - job_007 job_014: - name: "unit_test; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test --platform chrome`" + name: "unit_test; linux; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test --platform chrome`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -504,14 +504,14 @@ jobs: - job_006 - job_007 job_015: - name: "unit_test; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test --platform linux`" + name: "unit_test; linux; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:pkgs/flutter_http_example;commands:test_0" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:pkgs/flutter_http_example;commands:command_0" restore-keys: | os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:pkgs/flutter_http_example os:ubuntu-latest;pub-cache-hosted;sdk:stable @@ -529,8 +529,8 @@ jobs: run: flutter pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: pkgs/flutter_http_example - - name: "pkgs/flutter_http_example; flutter test --platform linux" - run: flutter test --platform linux + - name: pkgs/flutter_http_example; flutter test + run: flutter test if: "always() && steps.pkgs_flutter_http_example_pub_upgrade.conclusion == 'success'" working-directory: pkgs/flutter_http_example needs: @@ -542,19 +542,47 @@ jobs: - job_006 - job_007 job_016: - name: "unit_test; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" - runs-on: ubuntu-latest + name: "unit_test; macos; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" + runs-on: macos-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:pkgs/flutter_http_example;commands:command_0" + key: "os:macos-latest;pub-cache-hosted;sdk:stable;packages:pkgs/flutter_http_example;commands:command_0" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:pkgs/flutter_http_example - os:ubuntu-latest;pub-cache-hosted;sdk:stable - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest + os:macos-latest;pub-cache-hosted;sdk:stable;packages:pkgs/flutter_http_example + os:macos-latest;pub-cache-hosted;sdk:stable + os:macos-latest;pub-cache-hosted + os:macos-latest + - name: Setup Flutter SDK + uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa + with: + channel: stable + - id: checkout + name: Checkout repository + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - id: pkgs_flutter_http_example_pub_upgrade + name: pkgs/flutter_http_example; flutter pub upgrade + run: flutter pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: pkgs/flutter_http_example + - name: pkgs/flutter_http_example; flutter test + run: flutter test + if: "always() && steps.pkgs_flutter_http_example_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/flutter_http_example + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + - job_006 + - job_007 + job_017: + name: "unit_test; windows; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" + runs-on: windows-latest + steps: - name: Setup Flutter SDK uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa with: diff --git a/pkgs/flutter_http_example/mono_pkg.yaml b/pkgs/flutter_http_example/mono_pkg.yaml index 8482c0435d..8d8070e17c 100644 --- a/pkgs/flutter_http_example/mono_pkg.yaml +++ b/pkgs/flutter_http_example/mono_pkg.yaml @@ -3,9 +3,12 @@ sdk: stages: - analyze_and_format: - - analyze: --fatal-infos - - format: + - analyze: --fatal-infos + - format: - unit_test: - - test: --platform linux - - test: --platform chrome - - command: flutter test + - test: + os: + - macos + - windows + - test: --platform chrome + - command: flutter test diff --git a/tool/ci.sh b/tool/ci.sh index 13a6149252..26395d208a 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -87,10 +87,6 @@ for PKG in ${PKGS}; do echo 'dart format --output=none --set-exit-if-changed .' dart format --output=none --set-exit-if-changed . || EXIT_CODE=$? ;; - test_0) - echo 'flutter test --platform linux' - flutter test --platform linux || EXIT_CODE=$? - ;; test_1) echo 'flutter test --platform chrome' flutter test --platform chrome || EXIT_CODE=$?