2024-01-06 03:50:05 +00:00
|
|
|
name: WEB-CI
|
|
|
|
|
|
|
|
on:
|
2024-04-02 07:55:15 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
build:
|
|
|
|
description: 'Build the web app'
|
|
|
|
required: true
|
|
|
|
default: 'true'
|
2024-01-06 03:50:05 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
NODE_VERSION: "18.16.0"
|
|
|
|
PNPM_VERSION: "8.5.0"
|
2024-04-23 13:46:57 +00:00
|
|
|
RUST_TOOLCHAIN: "1.77.2"
|
2024-01-06 03:50:05 +00:00
|
|
|
CARGO_MAKE_VERSION: "0.36.6"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
web-build:
|
|
|
|
if: github.event.pull_request.draft != true
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-04-02 07:55:15 +00:00
|
|
|
platform: [ ubuntu-latest ]
|
2024-01-06 03:50:05 +00:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
2024-02-17 13:38:12 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-06 03:50:05 +00:00
|
|
|
- name: setup node
|
2024-02-17 13:38:12 +00:00
|
|
|
uses: actions/setup-node@v4
|
2024-01-06 03:50:05 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
|
|
|
|
- name: Cache Rust Dependencies
|
|
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
with:
|
|
|
|
key: rust-dependencies-${{ runner.os }}
|
|
|
|
workspaces: |
|
|
|
|
frontend/rust-lib
|
|
|
|
frontend/appflowy_web/appflowy_wasm
|
|
|
|
|
2024-02-17 13:38:12 +00:00
|
|
|
# TODO: Can combine caching deps and node_modules in one
|
|
|
|
# See Glob patterns: https://github.com/actions/toolkit/tree/main/packages/glob
|
2024-01-06 03:50:05 +00:00
|
|
|
- name: Cache Node.js dependencies
|
2024-02-17 13:38:12 +00:00
|
|
|
uses: actions/cache@v4
|
2024-01-06 03:50:05 +00:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: npm-${{ runner.os }}
|
|
|
|
|
|
|
|
- name: Cache node_modules
|
2024-02-17 13:38:12 +00:00
|
|
|
uses: actions/cache@v4
|
2024-01-06 03:50:05 +00:00
|
|
|
with:
|
|
|
|
path: frontend/appflowy_web/node_modules
|
|
|
|
key: node-modules-${{ runner.os }}
|
|
|
|
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
id: rust_toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
|
|
|
|
- name: Install wasm-pack
|
|
|
|
run: cargo install wasm-pack
|
|
|
|
|
|
|
|
- uses: taiki-e/install-action@v2
|
|
|
|
with:
|
|
|
|
tool: cargo-make@${{ env.CARGO_MAKE_VERSION }}
|
|
|
|
|
|
|
|
- name: install dependencies
|
|
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
|
|
working-directory: frontend
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
npm install -g pnpm@${{ env.PNPM_VERSION }}
|
|
|
|
cargo make install_web_protobuf
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
working-directory: frontend/appflowy_web
|
|
|
|
run: |
|
|
|
|
pnpm install
|
2024-01-29 21:36:27 +00:00
|
|
|
pnpm run build_release_wasm
|