mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: use actions-cache to speed up dart & rust test.
This commit is contained in:
parent
8128283ad4
commit
65917da468
5
.github/workflows/ci.yaml
vendored
5
.github/workflows/ci.yaml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
- id: rust_toolchain
|
- id: rust_toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 'stable-2022-01-20'
|
||||||
|
|
||||||
- id: flutter
|
- id: flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
@ -47,7 +47,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
frontend/rust-lib/target
|
frontend/rust-lib/target
|
||||||
key: ${{ runner.os }}-rust-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
shared-lib/target
|
||||||
|
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: |
|
||||||
|
49
.github/workflows/dart_test.yml
vendored
49
.github/workflows/dart_test.yml
vendored
@ -2,9 +2,12 @@ name: Unit test(Flutter)
|
|||||||
|
|
||||||
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
|
||||||
@ -13,36 +16,56 @@ jobs:
|
|||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
|
||||||
- uses: subosito/flutter-action@v1
|
|
||||||
with:
|
|
||||||
channel: "stable"
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 'stable-2022-01-20'
|
||||||
|
|
||||||
|
- uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: 'stable'
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: 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
|
||||||
|
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') }}
|
||||||
|
|
||||||
- name: Deps Flutter
|
- name: Deps Flutter
|
||||||
|
working-directory: frontend/app_flowy
|
||||||
run: |
|
run: |
|
||||||
flutter config --enable-linux-desktop
|
flutter config --enable-linux-desktop
|
||||||
flutter doctor
|
|
||||||
working-directory: frontend/app_flowy
|
|
||||||
- name: Deps Rust
|
- name: Deps Rust
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
run: |
|
run: |
|
||||||
cargo install --force cargo-make
|
cargo install cargo-make
|
||||||
cargo install --force duckscript_cli
|
cargo install duckscript_cli
|
||||||
cargo make flowy_dev
|
cargo make flowy_dev
|
||||||
echo PATH="$PATH":"$HOME/.pub-cache/bin" >> $GITHUB_PATH
|
|
||||||
- name: Code Generation
|
- name: Code Generation
|
||||||
working-directory: frontend/app_flowy
|
working-directory: frontend/app_flowy
|
||||||
run: |
|
run: |
|
||||||
flutter packages pub get
|
flutter packages pub get
|
||||||
flutter packages pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
|
flutter packages pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
|
||||||
flutter packages pub run build_runner build --delete-conflicting-outputs
|
flutter packages pub run build_runner build --delete-conflicting-outputs
|
||||||
|
|
||||||
- name: Build FlowySDK
|
- name: Build FlowySDK
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
run: |
|
run: |
|
||||||
cargo make --profile development-linux-x86 flowy-sdk-dev
|
cargo make --profile development-linux-x86 flowy-sdk-dev
|
||||||
|
|
||||||
- name: Run bloc tests
|
- name: Run bloc tests
|
||||||
working-directory: frontend/app_flowy
|
working-directory: frontend/app_flowy
|
||||||
run: |
|
run: |
|
||||||
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -44,7 +44,7 @@ jobs:
|
|||||||
- name: Setup environment - Rust and Cargo
|
- name: Setup environment - Rust and Cargo
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 'stable-2022-01-20'
|
||||||
|
|
||||||
- name: Setup environment - Flutter
|
- name: Setup environment - Flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
@ -92,7 +92,7 @@ jobs:
|
|||||||
- name: Setup environment - Rust and Cargo
|
- name: Setup environment - Rust and Cargo
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 'stable-2022-01-20'
|
||||||
|
|
||||||
- name: Setup environment - Flutter
|
- name: Setup environment - Flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
|
4
.github/workflows/rust_lint.yml
vendored
4
.github/workflows/rust_lint.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 'stable-2022-01-20'
|
||||||
override: true
|
override: true
|
||||||
- run: rustup component add rustfmt
|
- run: rustup component add rustfmt
|
||||||
working-directory: frontend/rust-lib
|
working-directory: frontend/rust-lib
|
||||||
@ -39,7 +39,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 'stable-2022-01-20'
|
||||||
override: true
|
override: true
|
||||||
- run: rustup component add clippy
|
- run: rustup component add clippy
|
||||||
working-directory: frontend/rust-lib
|
working-directory: frontend/rust-lib
|
||||||
|
42
.github/workflows/rust_test.yml
vendored
42
.github/workflows/rust_test.yml
vendored
@ -2,12 +2,14 @@ name: Unit test(Rust)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches:
|
||||||
|
- 'main'
|
||||||
paths:
|
paths:
|
||||||
- 'frontend/rust-lib'
|
- 'frontend/rust-lib'
|
||||||
- 'shared-lib'
|
- 'shared-lib'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches:
|
||||||
|
- 'main'
|
||||||
paths:
|
paths:
|
||||||
- 'frontend/rust-lib'
|
- 'frontend/rust-lib'
|
||||||
- 'shared-lib'
|
- 'shared-lib'
|
||||||
@ -21,19 +23,35 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Install Rust
|
|
||||||
run: |
|
- id: rust_toolchain
|
||||||
curl \
|
uses: actions-rs/toolchain@v1
|
||||||
--proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
with:
|
||||||
source $HOME/.cargo/env
|
toolchain: 'stable-2022-01-20'
|
||||||
rustup toolchain install stable
|
|
||||||
rustup default stable
|
- name: 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
|
||||||
|
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') }}
|
||||||
|
|
||||||
- name: Install cargo-make
|
- name: Install cargo-make
|
||||||
run: cargo install --force cargo-make
|
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
run: cargo install cargo-make
|
||||||
|
|
||||||
- name: Run rust-lib tests
|
- name: Run rust-lib tests
|
||||||
run: cargo test --no-default-features
|
|
||||||
working-directory: frontend/rust-lib
|
working-directory: frontend/rust-lib
|
||||||
- name: Run shared-lib tests
|
|
||||||
run: cargo test --no-default-features
|
run: cargo test --no-default-features
|
||||||
|
|
||||||
|
- name: Run shared-lib tests
|
||||||
working-directory: shared-lib
|
working-directory: shared-lib
|
||||||
|
run: cargo test --no-default-features
|
Loading…
x
Reference in New Issue
Block a user