-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (56 loc) · 1.63 KB
/
Copy pathci.yml
File metadata and controls
71 lines (56 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: CI
on:
pull_request:
push:
branches:
- main
- master
permissions:
contents: read
jobs:
test:
name: Test and package
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: 安装 Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
cache: npm
- name: 安装依赖
run: npm ci
- name: 构建
run: npm run build
- name: 单元测试
run: npm test
- name: 文档链接检查
run: npm run docs:check
- name: 依赖审计
run: npm audit --omit=dev --audit-level=moderate
- name: 生成 SBOM
run: npm sbom --sbom-format cyclonedx --omit=dev > sbom.cdx.json
- name: 上传 SBOM
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: sbom-cyclonedx
path: sbom.cdx.json
if-no-files-found: error
- name: npm 打包检查
run: npm pack --dry-run
docker:
name: Docker build
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: 设置 Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: 构建镜像
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
push: false
load: true
tags: oceanbase-mcp:ci