43 lines
967 B
YAML
43 lines
967 B
YAML
# Gitea Actions:需开启 Actions 并注册 act_runner。
|
||
# act_runner 下 Job 容器内必须有 node(checkout/setup-node 的脚本依赖),请设置例如:
|
||
# GITEA_RUNNER_LABELS=ubuntu-latest:docker://node:22-bookworm
|
||
# 并与本文件 runs-on、Setup Node 版本一致;需挂载 /var/run/docker.sock。
|
||
|
||
name: CI
|
||
|
||
on:
|
||
push:
|
||
branches: [main, master]
|
||
pull_request:
|
||
branches: [main, master]
|
||
|
||
concurrency:
|
||
group: ci-${{ github.workflow }}-${{ github.ref }}
|
||
cancel-in-progress: true
|
||
|
||
jobs:
|
||
build:
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@v4
|
||
|
||
- name: Setup Node
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: "22"
|
||
cache: yarn
|
||
|
||
- name: Install
|
||
run: yarn install --frozen-lockfile
|
||
|
||
- name: Prettier check
|
||
run: yarn format:check
|
||
|
||
- name: ESLint
|
||
run: yarn lint
|
||
|
||
- name: Build
|
||
run: yarn build
|