refactor: move sql rewrite tool #240
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |