2023-06-22 12:14:02 +08:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
permissions: {}
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
timeout-minutes: 20
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Unit Test
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-11 16:38:31 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-06-22 12:14:02 +08:00
|
|
|
|
|
|
|
- name: Install pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
|
|
|
|
|
|
|
- name: Setup node
|
2023-10-30 16:23:13 +08:00
|
|
|
uses: actions/setup-node@v4
|
2023-06-22 12:14:02 +08:00
|
|
|
with:
|
|
|
|
node-version: lts/*
|
|
|
|
cache: pnpm
|
|
|
|
|
|
|
|
- name: Install deps
|
|
|
|
run: pnpm install
|
|
|
|
|
2024-01-21 17:25:13 +08:00
|
|
|
- name: Build
|
|
|
|
run: pnpm run build
|
|
|
|
|
2023-06-22 12:14:02 +08:00
|
|
|
- name: Test unit
|
|
|
|
run: pnpm run test
|
|
|
|
|
|
|
|
lint:
|
|
|
|
timeout-minutes: 10
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Lint
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-11 16:38:31 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-06-22 12:14:02 +08:00
|
|
|
|
|
|
|
- name: Install pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
|
|
|
|
|
|
|
- name: Setup node
|
2023-10-30 16:23:13 +08:00
|
|
|
uses: actions/setup-node@v4
|
2023-06-22 12:14:02 +08:00
|
|
|
with:
|
|
|
|
node-version: lts/*
|
|
|
|
cache: pnpm
|
|
|
|
|
|
|
|
- name: Install deps
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: Lint
|
|
|
|
run: pnpm run lint
|
|
|
|
|
|
|
|
- name: Check formatting
|
|
|
|
run: pnpm prettier --check .
|
|
|
|
|
|
|
|
- name: Typecheck
|
|
|
|
run: pnpm run typecheck
|