2024-04-29 06:32:14 +00:00
|
|
|
name: Web-CI
|
2024-04-03 11:25:54 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- ".github/workflows/web2_ci.yaml"
|
|
|
|
- "frontend/appflowy_web_app/**"
|
|
|
|
- "frontend/resources/**"
|
|
|
|
env:
|
|
|
|
NODE_VERSION: "18.16.0"
|
|
|
|
PNPM_VERSION: "8.5.0"
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
|
|
web-build:
|
|
|
|
if: github.event.pull_request.draft != true
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-04-29 06:32:14 +00:00
|
|
|
platform: [ ubuntu-20.04 ]
|
2024-04-03 11:25:54 +00:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Maximize build space (ubuntu only)
|
2024-04-29 06:32:14 +00:00
|
|
|
if: matrix.platform == 'ubuntu-20.04'
|
2024-04-03 11:25:54 +00:00
|
|
|
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: Node_modules cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: frontend/appflowy_web_app/node_modules
|
|
|
|
key: node-modules-${{ runner.os }}
|
2024-04-08 12:09:15 +00:00
|
|
|
|
2024-04-03 11:25:54 +00:00
|
|
|
- name: install frontend dependencies
|
|
|
|
working-directory: frontend/appflowy_web_app
|
|
|
|
run: |
|
|
|
|
pnpm install
|
2024-06-03 03:20:45 +00:00
|
|
|
- name: Run lint check
|
2024-04-03 11:25:54 +00:00
|
|
|
working-directory: frontend/appflowy_web_app
|
|
|
|
run: |
|
|
|
|
pnpm run lint
|
2024-06-03 03:20:45 +00:00
|
|
|
|
2024-04-08 12:09:15 +00:00
|
|
|
- name: build and analyze
|
2024-04-03 11:25:54 +00:00
|
|
|
working-directory: frontend/appflowy_web_app
|
|
|
|
run: |
|
2024-04-08 12:09:15 +00:00
|
|
|
pnpm run analyze >> analyze-size.txt
|
|
|
|
- name: Upload analyze-size.txt
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: analyze-size.txt
|
|
|
|
path: frontend/appflowy_web_app/analyze-size.txt
|
|
|
|
retention-days: 30
|
|
|
|
- name: Upload stats.html
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: stats.html
|
|
|
|
path: frontend/appflowy_web_app/dist/stats.html
|
|
|
|
retention-days: 30
|