mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 08:05:12 +00:00
backend-security 的 govulncheck 现在报标准库漏洞:
Vulnerability #1: GO-2026-6859
HTTP/1 server crash due to MaxBytesReader header race in net/http
Found in: net/http@go1.27.3
Fixed in: net/http@go1.27.4
仓库把 Go 版本固定在 1.27.3(go.mod + workflow 硬断言 + 三个 Dockerfile),
所以所有 PR 的 backend-security 都会失败,与具体改动无关。
同步升级 8 处版本点:
- backend/go.mod:go 1.27.3 → 1.27.4
- security-scan.yml / backend-ci.yml(两处)/ release.yml:go1.27.4 断言
- Dockerfile / deploy/Dockerfile / backend/Dockerfile:golang:1.27.4-alpine
- DEV_GUIDE.md 的 CI 要求说明同步更新
验证:GOTOOLCHAIN=go1.27.4 go build ./... 通过,
GOTOOLCHAIN=go1.27.4 go test -tags unit ./internal/service/ 针对性用例通过。
96 lines
2.7 KiB
YAML
96 lines
2.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
shell:
|
|
runs-on: macos-15
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Check deployment scripts
|
|
run: |
|
|
/bin/bash -n deploy/apple-container.sh
|
|
/bin/bash deploy/tests/apple-container-test.sh
|
|
/bin/sh deploy/tests/docker-compose-security-test.sh
|
|
/bin/sh deploy/tests/docker-compose-gateway-env-test.sh
|
|
/bin/sh deploy/tests/docker-runtime-resources-test.sh
|
|
/bin/sh deploy/test-caddyfile-cache.sh
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Check Docker Compose simple mode environment
|
|
run: /bin/sh deploy/tests/docker-compose-simple-mode-env-test.sh
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: backend/go.mod
|
|
check-latest: false
|
|
cache: true
|
|
cache-dependency-path: backend/go.sum
|
|
- name: Verify Go version
|
|
run: |
|
|
go version | grep -q 'go1.27.4'
|
|
- name: Unit tests
|
|
working-directory: backend
|
|
run: make test-unit
|
|
- name: Integration tests
|
|
working-directory: backend
|
|
run: make test-integration
|
|
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
with:
|
|
version: 9
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '24'
|
|
cache: 'pnpm'
|
|
cache-dependency-path: frontend/pnpm-lock.yaml
|
|
- name: Install frontend dependencies
|
|
working-directory: frontend
|
|
run: pnpm install --frozen-lockfile
|
|
- name: Frontend typecheck and critical vitest
|
|
run: make test-frontend
|
|
|
|
golangci-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: backend/go.mod
|
|
check-latest: false
|
|
cache: true
|
|
cache-dependency-path: backend/go.sum
|
|
- name: Verify Go version
|
|
run: |
|
|
go version | grep -q 'go1.27.4'
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: v2.14.0
|
|
args: --timeout=30m
|
|
working-directory: backend
|
|
|
|
release-helpers:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.12'
|
|
- run: python -m pip install -r .github/release-tools/requirements-release.txt
|
|
- run: python -m unittest discover -s .github/release-tools -p 'test_release_matrix.py'
|
|
- run: bash -n .github/release-tools/release-images.sh
|