ci: merge testing workflow into build and release

This commit is contained in:
Haitao Pan 2026-04-10 20:17:11 +08:00
parent 7609e2b38d
commit 9dd0902dc7
4 changed files with 35 additions and 37 deletions

View File

@ -4,13 +4,12 @@ on:
push:
branches:
- main
- "release/**"
tags:
- "v*"
paths-ignore:
- "README.md"
pull_request:
branches:
- main
paths:
- "lib/**"
- "assets/**"
@ -39,6 +38,7 @@ env:
jobs:
prepare:
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main') }}
runs-on: ubuntu-22.04
needs:
- verify
@ -85,11 +85,28 @@ jobs:
shell: bash
run: bash ./scripts/ci/setup_platform_deps.sh linux
- name: Run analysis and tests
- name: Run Flutter verification suite
shell: bash
run: bash ./scripts/ci/run_code_analysis.sh
run: bash ./scripts/ci/run_flutter_ci_suite.sh
patrol:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/') }}
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Set up Flutter SDK
uses: ./.github/actions/setup-flutter-sdk
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Run Patrol suite
shell: bash
run: bash ./scripts/ci/run_patrol_suite.sh
build:
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main') }}
name: Build ${{ matrix.platform }} ${{ matrix.package }}
strategy:
fail-fast: false

View File

@ -1,33 +0,0 @@
name: testing
on:
pull_request:
push:
branches:
- main
- 'release/**'
jobs:
flutter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter pub get
- run: flutter test
- run: flutter test test/golden
- run: flutter test integration_test
patrol:
if: startsWith(github.ref, 'refs/heads/release/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter pub get
- run: dart pub global activate patrol_cli
- run: patrol test

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
flutter pub get
flutter analyze
flutter test
flutter test test/golden
flutter test integration_test

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
flutter pub get
dart pub global activate patrol_cli
patrol test