mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
a180cfcdc2
* chore: support publish tauri app * chore: fixed others bugs * fix: code review * fix: code review * fix: tauri ci
113 lines
3.1 KiB
YAML
113 lines
3.1 KiB
YAML
name: Tauri-CI
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- ".github/workflows/tauri_ci.yaml"
|
|
- "frontend/rust-lib/**"
|
|
- "frontend/appflowy_tauri/**"
|
|
- "frontend/resources/**"
|
|
|
|
env:
|
|
NODE_VERSION: "18.16.0"
|
|
PNPM_VERSION: "8.5.0"
|
|
RUST_TOOLCHAIN: "1.75"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
tauri-build:
|
|
if: github.event.pull_request.draft != true
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform: [ubuntu-latest]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
env:
|
|
CI: true
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Maximize build space (ubuntu only)
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
run: |
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf "/usr/local/share/boost"
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
sudo docker image prune --all --force
|
|
sudo rm -rf /opt/hostedtoolcache/codeQL
|
|
sudo rm -rf ${GITHUB_WORKSPACE}/.git
|
|
sudo rm -rf $ANDROID_HOME/ndk
|
|
|
|
- name: setup node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: setup pnpm
|
|
uses: pnpm/action-setup@v2
|
|
with:
|
|
version: ${{ env.PNPM_VERSION }}
|
|
|
|
- name: Install Rust toolchain
|
|
id: rust_toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
override: true
|
|
profile: minimal
|
|
|
|
- name: Rust cache
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: "./frontend/appflowy_tauri/src-tauri -> target"
|
|
|
|
- name: Node_modules cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: frontend/appflowy_tauri/node_modules
|
|
key: node-modules-${{ runner.os }}
|
|
|
|
- name: install dependencies (windows only)
|
|
if: matrix.platform == 'windows-latest'
|
|
working-directory: frontend
|
|
run: |
|
|
cargo install --force duckscript_cli
|
|
vcpkg integrate install
|
|
|
|
- name: install dependencies (ubuntu only)
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
working-directory: frontend
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
|
|
|
|
- name: install cargo-make
|
|
working-directory: frontend
|
|
run: |
|
|
cargo install --force cargo-make
|
|
cargo make appflowy-tauri-deps-tools
|
|
|
|
- name: install frontend dependencies
|
|
working-directory: frontend/appflowy_tauri
|
|
run: |
|
|
mkdir dist
|
|
pnpm install
|
|
cargo make --cwd .. tauri_build
|
|
|
|
- name: frontend tests and linting
|
|
working-directory: frontend/appflowy_tauri
|
|
run: |
|
|
pnpm test
|
|
pnpm test:errors
|
|
|
|
- uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tauriScript: pnpm tauri
|
|
projectPath: frontend/appflowy_tauri |