From b06e254e7afa219b01628f11c57f021a7efa478f Mon Sep 17 00:00:00 2001 From: Kenzie Davisson <43759233+kenzieschmoll@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:50:00 -0800 Subject: [PATCH] Separate package testing workflow from "main" job (#6745) --- .github/workflows/build.yaml | 25 +++++++++++++++++++++++++ tool/ci/bots.sh | 24 ------------------------ tool/ci/package_tests.sh | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 24 deletions(-) create mode 100755 tool/ci/package_tests.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7264d0910b0..dc6a72a82b7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -74,6 +74,31 @@ jobs: run: | dcm analyze packages/devtools_app packages/devtools_shared packages/devtools_test + test-packages: + name: ${{ matrix.package }} test + needs: flutter-prep + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + package: + - devtools_app_shared + - devtools_extensions + - devtools_shared + steps: + - name: git clone + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac + - name: Load Cached Flutter SDK + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + with: + path: | + ./flutter-sdk + key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }} + - name: tool/ci/package_tests.sh + env: + PACKAGE: ${{ matrix.package }} + run: ./tool/ci/package_tests.sh + test: name: ${{ matrix.bot }} needs: flutter-prep diff --git a/tool/ci/bots.sh b/tool/ci/bots.sh index 9b9b9036fd2..eb7ff6137de 100755 --- a/tool/ci/bots.sh +++ b/tool/ci/bots.sh @@ -29,30 +29,6 @@ if [ "$BOT" = "main" ]; then # Analyze the code devtools_tool analyze - popd - - # Test the `devtools_app_shared`, `devtools_shared` and `devtools_extensions` package tests on the - # main bot. - pushd $DEVTOOLS_DIR/packages/devtools_app_shared - echo `pwd` - flutter test test/ - popd - - pushd $DEVTOOLS_DIR/packages/devtools_shared - echo `pwd` - flutter test test/ - popd - - pushd $DEVTOOLS_DIR/packages/devtools_extensions - echo `pwd` - flutter test test/*_test.dart - flutter test test/web --platform chrome - popd - - # Change the directory back to devtools_app. - pushd $DEVTOOLS_DIR/packages/devtools_app - echo `pwd` - elif [ "$BOT" = "build_ddc" ]; then # TODO(https://github.com/flutter/flutter/issues/43538): Remove workaround. diff --git a/tool/ci/package_tests.sh b/tool/ci/package_tests.sh new file mode 100755 index 00000000000..0f0c9b56fd4 --- /dev/null +++ b/tool/ci/package_tests.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Fast fail the script on failures. +set -ex + +source ./tool/ci/setup.sh + +if [ "$PACKAGE" = "devtools_app_shared" ]; then + + pushd $DEVTOOLS_DIR/packages/devtools_app_shared + echo `pwd` + flutter test test/ + popd + +elif [ "$PACKAGE" = "devtools_extensions" ]; then + + pushd $DEVTOOLS_DIR/packages/devtools_extensions + echo `pwd` + flutter test test/*_test.dart + flutter test test/web --platform chrome + popd + +elif [ "$PACKAGE" = "devtools_shared" ]; then + + pushd $DEVTOOLS_DIR/packages/devtools_shared + echo `pwd` + flutter test test/ + popd + +fi