2023-02-10 06:30:34 +00:00
|
|
|
name: Tauri-CI
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
2023-06-22 13:22:46 +00:00
|
|
|
- ".github/workflows/tauri_ci.yaml"
|
2023-05-10 06:45:39 +00:00
|
|
|
- "frontend/rust-lib/**"
|
|
|
|
- "frontend/appflowy_tauri/**"
|
2024-02-17 13:38:12 +00:00
|
|
|
- "frontend/resources/**"
|
2023-02-10 06:30:34 +00:00
|
|
|
|
|
|
|
env:
|
2023-05-10 09:21:41 +00:00
|
|
|
NODE_VERSION: "18.16.0"
|
|
|
|
PNPM_VERSION: "8.5.0"
|
2023-12-29 17:22:06 +00:00
|
|
|
RUST_TOOLCHAIN: "1.75"
|
2023-02-10 06:30:34 +00:00
|
|
|
|
2023-06-22 13:22:46 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-02-10 06:30:34 +00:00
|
|
|
jobs:
|
|
|
|
tauri-build:
|
2023-06-22 13:22:46 +00:00
|
|
|
if: github.event.pull_request.draft != true
|
2023-02-10 06:30:34 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-02-17 13:38:12 +00:00
|
|
|
platform: [ubuntu-latest]
|
2023-02-10 06:30:34 +00:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.platform }}
|
2024-03-07 05:46:09 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CI: true
|
2023-02-10 06:30:34 +00:00
|
|
|
steps:
|
2024-03-07 05:46:09 +00:00
|
|
|
- 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
|
|
|
|
|
2023-02-10 06:30:34 +00:00
|
|
|
- name: setup node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
|
2024-03-07 05:46:09 +00:00
|
|
|
- name: setup pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
2023-09-11 10:59:35 +00:00
|
|
|
with:
|
2024-03-07 05:46:09 +00:00
|
|
|
version: ${{ env.PNPM_VERSION }}
|
2023-09-11 10:59:35 +00:00
|
|
|
|
2023-02-10 06:30:34 +00:00
|
|
|
- name: Install Rust toolchain
|
|
|
|
id: rust_toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
|
2024-03-07 05:46:09 +00:00
|
|
|
- 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 }}
|
|
|
|
|
2023-02-10 06:30:34 +00:00
|
|
|
- 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)
|
2023-06-06 08:03:29 +00:00
|
|
|
if: matrix.platform == 'ubuntu-latest'
|
2023-02-10 06:30:34 +00:00
|
|
|
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
|
|
|
|
|
2024-03-07 05:46:09 +00:00
|
|
|
- name: install cargo-make
|
2023-02-10 06:30:34 +00:00
|
|
|
working-directory: frontend
|
|
|
|
run: |
|
|
|
|
cargo install --force cargo-make
|
|
|
|
cargo make appflowy-tauri-deps-tools
|
|
|
|
|
2024-03-07 05:46:09 +00:00
|
|
|
- name: install frontend dependencies
|
2023-02-10 06:30:34 +00:00
|
|
|
working-directory: frontend/appflowy_tauri
|
|
|
|
run: |
|
|
|
|
mkdir dist
|
2023-05-10 05:27:50 +00:00
|
|
|
pnpm install
|
|
|
|
cargo make --cwd .. tauri_build
|
2023-02-10 06:30:34 +00:00
|
|
|
|
2024-03-07 05:46:09 +00:00
|
|
|
- name: frontend tests and linting
|
|
|
|
working-directory: frontend/appflowy_tauri
|
2023-09-11 10:59:35 +00:00
|
|
|
run: |
|
2024-03-07 05:46:09 +00:00
|
|
|
pnpm test
|
|
|
|
pnpm test:errors
|
2023-09-11 10:59:35 +00:00
|
|
|
|
2023-02-10 06:30:34 +00:00
|
|
|
- uses: tauri-apps/tauri-action@v0
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2024-03-07 05:46:09 +00:00
|
|
|
with:
|
|
|
|
tauriScript: pnpm tauri
|
|
|
|
projectPath: frontend/appflowy_tauri
|