Skip to content

Commit

Permalink
refactor CI testing of dart-services (#2719)
Browse files Browse the repository at this point in the history
refactor CI testing of dart-services; address several regressions
  • Loading branch information
devoncarew authored Nov 17, 2023
1 parent 1d5975a commit 5e300f9
Show file tree
Hide file tree
Showing 17 changed files with 136 additions and 510 deletions.
64 changes: 26 additions & 38 deletions .github/workflows/dart_services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,44 @@ 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:
working-directory: pkgs/dart_services/
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
1 change: 0 additions & 1 deletion .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions .github/workflows/sketch_pad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
2 changes: 0 additions & 2 deletions pkgs/dart_pad/web/example/embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
<script type="text/javascript">

const testSource = `void main() async {
await ui.webOnlyInitializePlatform();
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
Expand Down
6 changes: 1 addition & 5 deletions pkgs/dart_services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ The server will run from port 8080 and export several JSON APIs, like

To run tests:

`dart tool/grind.dart test`

or:

`grind deploy` for all tests and checks.
`dart test`

## Redis

Expand Down
235 changes: 0 additions & 235 deletions pkgs/dart_services/benchmark/bench.dart

This file was deleted.

Loading

0 comments on commit 5e300f9

Please sign in to comment.