2021-11-16 04:32:43 +00:00
|
|
|
name: CI
|
2022-02-26 14:56:48 +00:00
|
|
|
|
2021-11-16 04:32:43 +00:00
|
|
|
on:
|
|
|
|
push:
|
2022-02-26 14:56:48 +00:00
|
|
|
branches:
|
2022-08-11 15:35:07 +00:00
|
|
|
- "main"
|
|
|
|
|
2021-11-16 04:32:43 +00:00
|
|
|
pull_request:
|
2022-02-26 14:56:48 +00:00
|
|
|
branches:
|
2022-08-11 15:35:07 +00:00
|
|
|
- "main"
|
2022-02-26 14:56:48 +00:00
|
|
|
|
2021-11-23 09:53:08 +00:00
|
|
|
jobs:
|
2022-02-26 14:56:48 +00:00
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-10-08 14:20:30 +00:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2022-02-26 14:56:48 +00:00
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
2022-07-08 14:53:29 +00:00
|
|
|
flutter_profile: development-linux-x86_64
|
2022-02-26 14:56:48 +00:00
|
|
|
- os: macos-latest
|
2022-05-30 12:48:28 +00:00
|
|
|
flutter_profile: development-mac-x86_64
|
2022-10-08 14:20:30 +00:00
|
|
|
- os: windows-latest
|
2022-10-09 05:43:01 +00:00
|
|
|
flutter_profile: development(production)-windows-x86
|
2022-02-26 14:56:48 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2021-11-16 04:32:43 +00:00
|
|
|
steps:
|
2022-02-26 14:56:48 +00:00
|
|
|
- uses: actions/checkout@v2
|
2022-08-11 15:35:07 +00:00
|
|
|
|
2022-02-26 14:56:48 +00:00
|
|
|
- id: rust_toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
2022-02-12 02:57:02 +00:00
|
|
|
with:
|
2022-08-11 15:35:07 +00:00
|
|
|
toolchain: "stable-2022-01-20"
|
|
|
|
|
2022-02-26 14:56:48 +00:00
|
|
|
- id: flutter
|
|
|
|
uses: subosito/flutter-action@v2
|
2021-11-24 05:51:40 +00:00
|
|
|
with:
|
2022-08-11 15:35:07 +00:00
|
|
|
channel: "stable"
|
2022-02-26 14:56:48 +00:00
|
|
|
cache: true
|
2022-08-11 15:35:07 +00:00
|
|
|
flutter-version: "3.0.5"
|
2022-02-26 14:56:48 +00:00
|
|
|
|
|
|
|
- name: Cache Cargo
|
2022-08-11 15:35:07 +00:00
|
|
|
id: cache-cargo
|
2022-02-26 14:56:48 +00:00
|
|
|
uses: actions/cache@v2
|
2022-08-11 15:35:07 +00:00
|
|
|
with:
|
2022-02-26 14:56:48 +00:00
|
|
|
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
|
2022-08-11 15:35:07 +00:00
|
|
|
with:
|
2022-02-26 14:56:48 +00:00
|
|
|
path: |
|
|
|
|
frontend/rust-lib/target
|
2022-03-01 07:43:42 +00:00
|
|
|
shared-lib/target
|
2022-08-11 15:35:07 +00:00
|
|
|
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
2022-02-26 14:56:48 +00:00
|
|
|
|
|
|
|
- name: Setup Environment
|
2022-08-11 15:35:07 +00:00
|
|
|
run: |
|
2022-02-26 14:56:48 +00:00
|
|
|
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/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y dart curl build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
|
2022-08-09 02:39:33 +00:00
|
|
|
sudo apt-get install keybinder-3.0
|
2022-02-26 14:56:48 +00:00
|
|
|
elif [ "$RUNNER_OS" == "macOS" ]; then
|
|
|
|
echo 'do nothing'
|
|
|
|
fi
|
|
|
|
shell: bash
|
|
|
|
|
2022-08-11 15:35:07 +00:00
|
|
|
- if: steps.cache-cargo.outputs.cache-hit != 'true'
|
|
|
|
name: Deps
|
2021-11-24 05:51:40 +00:00
|
|
|
working-directory: frontend
|
2021-11-23 08:54:40 +00:00
|
|
|
run: |
|
2022-02-26 14:56:48 +00:00
|
|
|
cargo install cargo-make
|
|
|
|
cargo install duckscript_cli
|
2022-08-11 15:35:07 +00:00
|
|
|
|
|
|
|
- name: Cargo make flowy_dev
|
|
|
|
working-directory: frontend
|
|
|
|
run: |
|
2021-11-23 08:54:40 +00:00
|
|
|
cargo make flowy_dev
|
2022-02-26 14:56:48 +00:00
|
|
|
|
|
|
|
- name: Config Flutter
|
2021-11-21 03:31:37 +00:00
|
|
|
run: |
|
2022-02-26 14:56:48 +00:00
|
|
|
if [ "$RUNNER_OS" == "Linux" ]; then
|
|
|
|
flutter config --enable-linux-desktop
|
|
|
|
elif [ "$RUNNER_OS" == "macOS" ]; then
|
|
|
|
flutter config --enable-macos-desktop
|
2022-10-09 05:43:01 +00:00
|
|
|
if [ "$RUNNER_OS" == "windows" ]; then
|
|
|
|
flutter config --enable-windows-desktop
|
2022-02-26 14:56:48 +00:00
|
|
|
fi
|
|
|
|
shell: bash
|
|
|
|
|
2021-11-23 08:54:40 +00:00
|
|
|
- name: Build
|
2021-12-02 17:50:03 +00:00
|
|
|
working-directory: frontend
|
2022-02-26 14:56:48 +00:00
|
|
|
run: |
|
2022-07-08 14:53:29 +00:00
|
|
|
cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev
|