feat: add lint during ci

Signed-off-by: d0zingcat <iamtangli42@gmail.com>
This commit is contained in:
2026-01-14 20:25:08 +08:00
parent a43fad3440
commit 99fa772000
3 changed files with 26 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
name: Build and Push Docker Images name: CI
on: on:
push: push:
@@ -11,7 +11,27 @@ env:
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: ${{ github.repository }}
jobs: jobs:
build-and-push: lint:
name: Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run Biome Check
run: bun x @biomejs/biome ci .
build:
name: Build & Push Docker
needs: lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
@@ -22,6 +42,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Log in to the Container registry - name: Log in to the Container registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
@@ -33,7 +54,7 @@ jobs:
with: with:
context: . context: .
file: Dockerfile file: Dockerfile
push: true push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: | tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}

View File

@@ -10,6 +10,7 @@
### 变更 ### 变更
- **Linting**: 强化了 Biome 配置,启用了更严格的 `a11y` (可访问性), `suspicious` (可疑代码), `style` (代码规范) 和 `correctness` (正确性) 检查规则。 - **Linting**: 强化了 Biome 配置,启用了更严格的 `a11y` (可访问性), `suspicious` (可疑代码), `style` (代码规范) 和 `correctness` (正确性) 检查规则。
- **配置**: 配置 `noUnknownAtRules` 规则以忽略 Tailwind CSS 特有的 At-rules。 - **配置**: 配置 `noUnknownAtRules` 规则以忽略 Tailwind CSS 特有的 At-rules。
- **CI/CD**: 集成 Biome 检查到 GitHub Actions 工作流,确保在所有 Pull Request 中强制执行代码规范检查。
### 修复 ### 修复
- **Web 可访问性**: 为所有按钮添加了显式的 `type="button"` 以符合规范。 - **Web 可访问性**: 为所有按钮添加了显式的 `type="button"` 以符合规范。

View File

@@ -72,4 +72,4 @@
} }
} }
} }
} }