Files
haopengzhan d7ed8876dc
CI Quality Checks & Tests / Frontend Typecheck & Build (push) Successful in 1m28s
CI Quality Checks & Tests / Gitleaks Secret Detection (push) Failing after 3m29s
CI Quality Checks & Tests / Go Lint & Unit Tests (push) Failing after 3h12m8s
fix: resolve all golangci-lint errors and integrate linter into CI/CD, Makefile, and check script
2026-08-24 21:46:52 -07:00

78 lines
1.7 KiB
YAML

name: CI Quality Checks & Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
backend-test:
name: Go Lint & Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Verify Formatting (gofmt)
run: |
UNFORMATTED=$(gofmt -l internal/ cmd/)
if [ -n "$UNFORMATTED" ]; then
echo "Unformatted files found:"
echo "$UNFORMATTED"
exit 1
fi
- name: Run Go Vet
run: go vet ./...
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
- name: Run Go Unit Tests
run: go test -v ./...
frontend-build:
name: Frontend Typecheck & Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install Frontend Dependencies
working-directory: web
run: npm ci || npm install
- name: TypeScript Check & Vite Build
working-directory: web
run: npm run build
security-scan:
name: Gitleaks Secret Detection
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Gitleaks Scan
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}