2023-06-15 00:50:50 +08:00
|
|
|
name: Lint Code
|
2021-09-19 17:16:41 +08:00
|
|
|
on:
|
2021-09-27 12:29:09 +08:00
|
|
|
push:
|
2021-10-11 14:21:37 +08:00
|
|
|
branches:
|
|
|
|
- main
|
2021-10-12 23:24:31 +08:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2021-09-19 17:16:41 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-06-15 00:50:50 +08:00
|
|
|
name: Lint Code
|
2021-09-19 17:16:41 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-15 00:50:50 +08:00
|
|
|
- name: Checkout repository
|
2024-04-03 12:23:16 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-06-15 00:50:50 +08:00
|
|
|
|
|
|
|
- name: Install Node.js
|
2024-04-03 12:23:16 +08:00
|
|
|
uses: actions/setup-node@v4
|
2021-09-27 12:29:09 +08:00
|
|
|
with:
|
2024-04-03 12:23:16 +08:00
|
|
|
node-version: 20
|
2021-09-27 12:29:09 +08:00
|
|
|
|
2024-04-03 12:23:16 +08:00
|
|
|
- uses: pnpm/action-setup@v3
|
2023-06-15 00:50:50 +08:00
|
|
|
name: Install pnpm
|
|
|
|
id: pnpm-install
|
2021-11-03 14:16:34 +08:00
|
|
|
with:
|
2024-05-13 22:45:19 +08:00
|
|
|
version: 9
|
2023-06-15 00:50:50 +08:00
|
|
|
run_install: false
|
|
|
|
|
|
|
|
- name: Get pnpm store directory
|
|
|
|
id: pnpm-cache
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
2021-11-03 14:16:34 +08:00
|
|
|
|
2024-04-03 12:23:16 +08:00
|
|
|
- uses: actions/cache@v4
|
2023-06-15 00:50:50 +08:00
|
|
|
name: Setup pnpm cache
|
2021-11-03 14:16:34 +08:00
|
|
|
with:
|
2023-06-15 00:50:50 +08:00
|
|
|
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pnpm-store-
|
2021-11-03 14:16:34 +08:00
|
|
|
|
2023-06-15 00:50:50 +08:00
|
|
|
- name: Start Lint Code
|
2021-09-25 20:58:48 +08:00
|
|
|
run: |
|
2023-03-28 17:09:57 +08:00
|
|
|
pnpm install --no-frozen-lockfile
|
2021-11-03 14:16:34 +08:00
|
|
|
pnpm lint
|
2022-07-18 16:07:03 +08:00
|
|
|
pnpm typecheck
|
2021-09-19 17:32:47 +08:00
|
|
|
env:
|
2021-09-19 18:07:38 +08:00
|
|
|
VALIDATE_ALL_CODEBASE: false
|
|
|
|
DEFAULT_BRANCH: main
|
2021-09-19 17:32:47 +08:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|