Skip to content

Fix: /heath for http, sse #555

Fix: /heath for http, sse

Fix: /heath for http, sse #555

Workflow file for this run

name: Go CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
format-and-vet:
name: Format and Vet
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.24'
check-latest: true
cache: true
- name: Check formatting
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "The following files are not formatted correctly:"
gofmt -s -l .
echo "Please run 'go fmt ./...' to fix formatting issues."
exit 1
fi
- name: Run go vet
run: go vet ./...
lint:
name: Lint
runs-on: ubuntu-latest
needs: [format-and-vet]
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.24'
check-latest: true
cache: true
- name: Lint
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --timeout=5m
test:
name: Test
runs-on: ubuntu-latest
needs: [format-and-vet]
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.24'
check-latest: true
cache: true
- name: Install dependencies
run: go mod download
- name: Run tests with coverage
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.txt
fail_ci_if_error: false
continue-on-error: true
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: coverage.txt
retention-days: 14
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.24'
check-latest: true
cache: true
- name: Build Linux binary
run: |
go build -o aks-mcp ./cmd/aks-mcp
- name: Build Windows binary
run: |
GOOS=windows GOARCH=amd64 go build -trimpath -tags withoutebpf -o aks-mcp.exe ./cmd/aks-mcp
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Linux Docker image
uses: docker/build-push-action@v6
with:
push: false
platforms: linux/amd64
tags: aks-mcp:linux-test
file: ./Dockerfile
load: true
- name: Validate Linux Docker image
run: |
docker images aks-mcp:linux-test
docker run --rm aks-mcp:linux-test --help || true
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: ./...