chore: optimize CI (#2875)

This commit is contained in:
Lucas.Xu 2023-06-22 21:22:46 +08:00 committed by GitHub
parent a29c8ab27a
commit feceb430cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 14 deletions

View File

@ -21,12 +21,13 @@ on:
- unlocked - unlocked
- ready_for_review - ready_for_review
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs: jobs:
build-app: build-app:
if: github.event.pull_request.draft != true if: github.event.pull_request.draft != true
concurrency:
group: docker_ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout source code - name: Checkout source code

View File

@ -25,8 +25,13 @@ env:
FLUTTER_VERSION: "3.10.1" FLUTTER_VERSION: "3.10.1"
RUST_TOOLCHAIN: "1.70" RUST_TOOLCHAIN: "1.70"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
if: github.event.pull_request.draft != true
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -102,7 +107,6 @@ jobs:
git config --system core.longpaths true git config --system core.longpaths true
flutter config --enable-windows-desktop flutter config --enable-windows-desktop
fi fi
dart pub global activate protoc_plugin 20.0.1
shell: bash shell: bash
- name: Build AppFlowy - name: Build AppFlowy

View File

@ -6,7 +6,7 @@ on:
- "main" - "main"
- "release/*" - "release/*"
paths: paths:
- ".github/workflows/flutter_ci.yaml" - ".github/workflows/integration_test.yml"
- "frontend/**" - "frontend/**"
- "!frontend/appflowy_tauri/**" - "!frontend/appflowy_tauri/**"
@ -15,7 +15,7 @@ on:
- "main" - "main"
- "release/*" - "release/*"
paths: paths:
- ".github/workflows/flutter_ci.yaml" - ".github/workflows/integration_test.yml"
- "frontend/**" - "frontend/**"
- "!frontend/appflowy_tauri/**" - "!frontend/appflowy_tauri/**"
@ -24,8 +24,13 @@ env:
FLUTTER_VERSION: "3.10.1" FLUTTER_VERSION: "3.10.1"
RUST_TOOLCHAIN: "1.70" RUST_TOOLCHAIN: "1.70"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs: jobs:
tests: tests:
if: github.event.pull_request.draft != true
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest] os: [ubuntu-latest]
@ -43,7 +48,6 @@ jobs:
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: ${{ env.RUST_TOOLCHAIN }} toolchain: ${{ env.RUST_TOOLCHAIN }}
target: ${{ matrix.target }}
override: true override: true
profile: minimal profile: minimal
@ -92,7 +96,6 @@ jobs:
elif [ "$RUNNER_OS" == "Windows" ]; then elif [ "$RUNNER_OS" == "Windows" ]; then
flutter config --enable-windows-desktop flutter config --enable-windows-desktop
fi fi
dart pub global activate protoc_plugin 20.0.1
shell: bash shell: bash
- name: Build Test lib - name: Build Test lib
@ -114,11 +117,11 @@ jobs:
export DISPLAY=:99 export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
sudo apt-get install network-manager sudo apt-get install network-manager
flutter test integration_test/runner.dart -d Linux --coverage --verbose flutter test integration_test/runner.dart -d Linux --coverage
elif [ "$RUNNER_OS" == "macOS" ]; then elif [ "$RUNNER_OS" == "macOS" ]; then
flutter test integration_test/runner.dart -d macOS --coverage --verbose flutter test integration_test/runner.dart -d macOS --coverage
elif [ "$RUNNER_OS" == "Windows" ]; then elif [ "$RUNNER_OS" == "Windows" ]; then
flutter test integration_test/runner.dart -d Windows --coverage --verbose flutter test integration_test/runner.dart -d Windows --coverage
fi fi
shell: bash shell: bash

View File

@ -2,6 +2,7 @@ name: Tauri-CI
on: on:
pull_request: pull_request:
paths: paths:
- ".github/workflows/tauri_ci.yaml"
- "frontend/rust-lib/**" - "frontend/rust-lib/**"
- "frontend/appflowy_tauri/**" - "frontend/appflowy_tauri/**"
@ -10,8 +11,13 @@ env:
PNPM_VERSION: "8.5.0" PNPM_VERSION: "8.5.0"
RUST_TOOLCHAIN: "1.70" RUST_TOOLCHAIN: "1.70"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs: jobs:
tauri-build: tauri-build:
if: github.event.pull_request.draft != true
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:

View File

@ -169,7 +169,7 @@ script = ["""
cd appflowy_flutter/ cd appflowy_flutter/
flutter clean flutter clean
flutter pub get flutter pub get
flutter build ${TARGET_OS} --${BUILD_FLAG} --verbose flutter build ${TARGET_OS} --${BUILD_FLAG}
"""] """]
script_runner = "@shell" script_runner = "@shell"

View File

@ -33,7 +33,7 @@ dependencies = ["inner_build_test_backend"]
description = "Run flutter unit tests" description = "Run flutter unit tests"
script = ''' script = '''
cd appflowy_flutter cd appflowy_flutter
flutter test --dart-define=RUST_LOG=${RUST_LOG} -j, --concurrency=1 --coverage --verbose flutter test --dart-define=RUST_LOG=${RUST_LOG} -j, --concurrency=1 --coverage
''' '''
[tasks.rust_unit_test] [tasks.rust_unit_test]