From 5e300f9bf5c535febe65d4d635f28ff4a236fcd0 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 17 Nov 2023 11:22:13 -0800 Subject: [PATCH] refactor CI testing of dart-services (#2719) refactor CI testing of dart-services; address several regressions --- .github/workflows/dart_services.yml | 64 ++--- .github/workflows/samples.yml | 1 - .github/workflows/sketch_pad.yml | 2 - pkgs/dart_pad/web/example/embed.html | 2 - pkgs/dart_services/README.md | 6 +- pkgs/dart_services/benchmark/bench.dart | 235 ------------------ pkgs/dart_services/benchmark/bench_impl.dart | 121 --------- pkgs/dart_services/lib/server.dart | 2 +- pkgs/dart_services/lib/src/common.dart | 21 +- pkgs/dart_services/lib/src/compiler.dart | 13 +- pkgs/dart_services/lib/src/sdk.dart | 91 ++++--- .../test/flutter_analysis_server_test.dart | 3 +- pkgs/dart_services/test/server_v3_test.dart | 6 +- .../dependencies/pub_dependencies_beta.json | 2 +- .../dependencies/pub_dependencies_main.json | 4 +- pkgs/dart_services/tool/grind.dart | 65 +---- pkgs/sketch_pad/lib/samples.g.dart | 8 +- 17 files changed, 136 insertions(+), 510 deletions(-) delete mode 100644 pkgs/dart_services/benchmark/bench.dart delete mode 100644 pkgs/dart_services/benchmark/bench_impl.dart diff --git a/.github/workflows/dart_services.yml b/.github/workflows/dart_services.yml index c7fa99cad..1e22e8605 100644 --- a/.github/workflows/dart_services.yml +++ b/.github/workflows/dart_services.yml @@ -12,12 +12,11 @@ on: - '.github/workflows/dart_services.yml' - 'pkgs/dart_services/**' schedule: - - cron: '0 0 * * 0' # weekly + - cron: '0 0 * * *' # daily jobs: - # Check code formatting, static analysis, and build on a single OS (linux) - # against Dart stable and beta. - analyze: + # Check code formatting, static analysis, and build on a single OS (linux). + verify: runs-on: ubuntu-latest defaults: run: @@ -25,43 +24,32 @@ jobs: strategy: fail-fast: false matrix: - sdk: [stable, beta, main] + sdk: [stable, beta, master] # main steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: subosito/flutter-action@aa6d9b984461fff0e0e0673f96483607df98db84 - - name: Install dependencies + with: + channel: ${{ matrix.sdk }} + - run: flutter --version + + - name: Install apt dependencies run: sudo apt-get install -y protobuf-compiler redis - - name: Install dependencies + + - name: Install dart dependencies run: dart pub get - - name: Analyze code - run: dart analyze --fatal-infos . - - name: check formatting - run: dart format --set-exit-if-changed lib test tool - - name: Run tests - env: - FLUTTER_CHANNEL: ${{ matrix.sdk }} - run: | - export PATH=$PATH:$HOME/.pub-cache/bin - dart pub global activate protoc_plugin - dart run grinder test - # Run the benchmarks on the bots to ensure they don't regress. - benchmark: - runs-on: ubuntu-latest - defaults: - run: - working-directory: pkgs/dart_services/ - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: subosito/flutter-action@aa6d9b984461fff0e0e0673f96483607df98db84 - - run: sudo apt-get install -y protobuf-compiler redis - - run: dart pub get - - name: Download the Flutter SDK - run: | - flutter doctor -v - - name: Prep the repo - env: - FLUTTER_CHANNEL: stable - run: dart run grinder buildbot - - name: Run benchmarks - run: dart benchmark/bench.dart + - name: Analyze project source + run: dart analyze --fatal-infos + + - name: Verify formatting + run: dart format --set-exit-if-changed bin lib test tool + + - name: Create template projects and populate the custom pub cache + run: dart run grinder build-project-templates + + # Build the web artifacts on the bots to ensure they don't regress. + - name: Build web artifacts + run: dart run grinder build-storage-artifacts + + - name: Run tests + run: dart test diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index 1846d3a57..19166dd2a 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -30,4 +30,3 @@ jobs: - run: dart format --set-exit-if-changed . - run: dart tool/samples.dart --verify - run: flutter build web - # - run: flutter test diff --git a/.github/workflows/sketch_pad.yml b/.github/workflows/sketch_pad.yml index 3776427c0..ba06c5357 100644 --- a/.github/workflows/sketch_pad.yml +++ b/.github/workflows/sketch_pad.yml @@ -25,8 +25,6 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b - with: - channel: 'stable' - run: flutter pub get - run: flutter analyze - run: dart format --set-exit-if-changed . diff --git a/pkgs/dart_pad/web/example/embed.html b/pkgs/dart_pad/web/example/embed.html index 16414470d..7e9d5071f 100644 --- a/pkgs/dart_pad/web/example/embed.html +++ b/pkgs/dart_pad/web/example/embed.html @@ -78,8 +78,6 @@