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:
20
.github/workflows/ci.yaml
vendored
20
.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:
|
||||||
@ -27,16 +27,17 @@ jobs:
|
|||||||
- 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: |
|
||||||
@ -52,7 +53,7 @@ jobs:
|
|||||||
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
|
||||||
|
33
.github/workflows/dart_lint.yml
vendored
33
.github/workflows/dart_lint.yml
vendored
@ -7,9 +7,9 @@ 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
|
||||||
@ -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
|
||||||
|
|
||||||
|
29
.github/workflows/dart_test.yml
vendored
29
.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
|
||||||
@ -21,12 +21,12 @@ jobs:
|
|||||||
|
|
||||||
- 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
|
||||||
@ -37,6 +37,7 @@ jobs:
|
|||||||
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: |
|
||||||
@ -44,16 +45,22 @@ jobs:
|
|||||||
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: |
|
||||||
|
Reference in New Issue
Block a user