mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: speed up ci by respecting the cargo deps cache
This commit is contained in:
32
.github/workflows/ci.yaml
vendored
32
.github/workflows/ci.yaml
vendored
@ -3,11 +3,11 @@ name: CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- "main"
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- "main"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -23,36 +23,37 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- id: rust_toolchain
|
- id: rust_toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: 'stable-2022-01-20'
|
toolchain: "stable-2022-01-20"
|
||||||
|
|
||||||
- id: flutter
|
- id: flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: "stable"
|
||||||
cache: true
|
cache: true
|
||||||
flutter-version: '3.0.5'
|
flutter-version: "3.0.5"
|
||||||
|
|
||||||
- name: Cache Cargo
|
- name: Cache Cargo
|
||||||
|
id: cache-cargo
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo
|
~/.cargo
|
||||||
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
||||||
|
|
||||||
- name: Cache Rust
|
- name: Cache Rust
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
frontend/rust-lib/target
|
frontend/rust-lib/target
|
||||||
shared-lib/target
|
shared-lib/target
|
||||||
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
||||||
|
|
||||||
- name: Setup Environment
|
- name: Setup Environment
|
||||||
run: |
|
run: |
|
||||||
if [ "$RUNNER_OS" == "Linux" ]; then
|
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||||
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
|
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
|
||||||
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
|
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
|
||||||
@ -63,11 +64,16 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Deps
|
- if: steps.cache-cargo.outputs.cache-hit != 'true'
|
||||||
|
name: Deps
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
run: |
|
run: |
|
||||||
cargo install cargo-make
|
cargo install cargo-make
|
||||||
cargo install duckscript_cli
|
cargo install duckscript_cli
|
||||||
|
|
||||||
|
- name: Cargo make flowy_dev
|
||||||
|
working-directory: frontend
|
||||||
|
run: |
|
||||||
cargo make flowy_dev
|
cargo make flowy_dev
|
||||||
|
|
||||||
- name: Config Flutter
|
- name: Config Flutter
|
||||||
|
35
.github/workflows/dart_lint.yml
vendored
35
.github/workflows/dart_lint.yml
vendored
@ -7,14 +7,14 @@ name: Flutter lint
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
flutter-analyze:
|
flutter-analyze:
|
||||||
name: flutter analyze
|
name: flutter analyze
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -23,16 +23,38 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- uses: subosito/flutter-action@v1
|
- uses: subosito/flutter-action@v1
|
||||||
with:
|
with:
|
||||||
flutter-version: '3.0.5'
|
flutter-version: "3.0.5"
|
||||||
channel: "stable"
|
channel: "stable"
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: 'stable-2022-01-20'
|
toolchain: "stable-2022-01-20"
|
||||||
|
|
||||||
- name: Rust Deps
|
- name: Cache Cargo
|
||||||
|
id: cache-cargo
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo
|
||||||
|
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
||||||
|
|
||||||
|
- name: Cache Rust
|
||||||
|
id: cache-rust-target
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
frontend/rust-lib/target
|
||||||
|
shared-lib/target
|
||||||
|
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
||||||
|
|
||||||
|
- if: steps.cache-cargo.outputs.cache-hit != 'true'
|
||||||
|
name: Rust Deps
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
run: |
|
run: |
|
||||||
cargo install cargo-make
|
cargo install cargo-make
|
||||||
|
|
||||||
|
- name: Cargo make flowy dev
|
||||||
|
working-directory: frontend
|
||||||
|
run: |
|
||||||
cargo make flowy_dev
|
cargo make flowy_dev
|
||||||
|
|
||||||
- name: Flutter Deps
|
- name: Flutter Deps
|
||||||
@ -53,4 +75,3 @@ jobs:
|
|||||||
- name: Run Flutter Analyzer
|
- name: Run Flutter Analyzer
|
||||||
working-directory: frontend/app_flowy
|
working-directory: frontend/app_flowy
|
||||||
run: flutter analyze
|
run: flutter analyze
|
||||||
|
|
||||||
|
47
.github/workflows/dart_test.yml
vendored
47
.github/workflows/dart_test.yml
vendored
@ -3,12 +3,12 @@ name: Unit test(Flutter)
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- "main"
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- "main"
|
||||||
- 'feat/flowy_editor'
|
- "feat/flowy_editor"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
@ -18,42 +18,49 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: 'stable-2022-01-20'
|
toolchain: "stable-2022-01-20"
|
||||||
|
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: "stable"
|
||||||
flutter-version: '3.0.5'
|
flutter-version: "3.0.5"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Cache Cargo
|
- name: Cache Cargo
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo
|
~/.cargo
|
||||||
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
||||||
|
|
||||||
- name: Cache Rust
|
- name: Cache Rust
|
||||||
|
id: cache-rust-target
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
frontend/rust-lib/target
|
frontend/rust-lib/target
|
||||||
shared-lib/target
|
shared-lib/target
|
||||||
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
||||||
|
|
||||||
|
- if: steps.cache-cargo.outputs.cache-hit != 'true'
|
||||||
|
name: Rust Deps
|
||||||
|
working-directory: frontend
|
||||||
|
run: |
|
||||||
|
cargo install cargo-make
|
||||||
|
|
||||||
|
- name: Cargo make flowy dev
|
||||||
|
working-directory: frontend
|
||||||
|
run: |
|
||||||
|
cargo make flowy_dev
|
||||||
|
|
||||||
- name: Flutter Deps
|
- name: Flutter Deps
|
||||||
working-directory: frontend/app_flowy
|
working-directory: frontend/app_flowy
|
||||||
run: |
|
run: |
|
||||||
flutter config --enable-linux-desktop
|
flutter config --enable-linux-desktop
|
||||||
|
|
||||||
- name: Rust Deps
|
|
||||||
working-directory: frontend
|
|
||||||
run: |
|
|
||||||
cargo install cargo-make
|
|
||||||
cargo make flowy_dev
|
|
||||||
- name: Build FlowySDK
|
- name: Build FlowySDK
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
run: |
|
run: |
|
||||||
@ -65,7 +72,7 @@ jobs:
|
|||||||
flutter packages pub get
|
flutter packages pub get
|
||||||
flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json
|
flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json
|
||||||
flutter packages pub run build_runner build --delete-conflicting-outputs
|
flutter packages pub run build_runner build --delete-conflicting-outputs
|
||||||
|
|
||||||
- name: Run bloc tests
|
- name: Run bloc tests
|
||||||
working-directory: frontend/app_flowy
|
working-directory: frontend/app_flowy
|
||||||
run: |
|
run: |
|
||||||
@ -76,4 +83,4 @@ jobs:
|
|||||||
working-directory: frontend/app_flowy/packages/flowy_editor
|
working-directory: frontend/app_flowy/packages/flowy_editor
|
||||||
run: |
|
run: |
|
||||||
flutter pub get
|
flutter pub get
|
||||||
flutter test
|
flutter test
|
||||||
|
Reference in New Issue
Block a user