standalone gosec 扫描 24 万行 Go 代码在 CI 中持续超时, 将其作为 golangci-lint 的内置 linter 运行,复用 AST 解析和缓存大幅提速。 - 在 .golangci.yml 中启用 gosec 并迁移原有排除规则 - golangci-lint timeout 从 5m 提升到 30m - 从 security-scan.yml 移除 standalone gosec 步骤 - 删除不再需要的 .gosec.json 配置文件
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: backend/go.mod
|
|
check-latest: false
|
|
cache: true
|
|
- name: Verify Go version
|
|
run: |
|
|
go version | grep -q 'go1.25.7'
|
|
- name: Unit tests
|
|
working-directory: backend
|
|
run: make test-unit
|
|
- name: Integration tests
|
|
working-directory: backend
|
|
run: make test-integration
|
|
|
|
golangci-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: backend/go.mod
|
|
check-latest: false
|
|
cache: true
|
|
- name: Verify Go version
|
|
run: |
|
|
go version | grep -q 'go1.25.7'
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: v2.7
|
|
args: --timeout=30m
|
|
working-directory: backend |