mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-20 03:11:46 +00:00
76 lines
1.6 KiB
YAML
76 lines
1.6 KiB
YAML
name: Hive Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- test
|
|
paths:
|
|
- "**/*.go"
|
|
- go.mod
|
|
- go.sum
|
|
- Makefile
|
|
- .github/workflows/hive.yml
|
|
pull_request:
|
|
paths:
|
|
- "**/*.go"
|
|
- go.mod
|
|
- go.sum
|
|
- Makefile
|
|
- .github/workflows/hive.yml
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build_and_test:
|
|
name: Hive Build and Test
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
cache-dependency-path: "go.sum"
|
|
go-version-file: "go.mod"
|
|
|
|
- name: Build Hive
|
|
run: make go_build
|
|
|
|
- name: Run Tests
|
|
run: LOG_IGNORE=1 go test -v -timeout 120s ./...
|
|
|
|
lint_and_security:
|
|
name: Hive Lint and Security
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
cache-dependency-path: "go.sum"
|
|
go-version-file: "go.mod"
|
|
|
|
- name: Check gofmt
|
|
run: |
|
|
if [ -n "$(gofmt -l .)" ]; then
|
|
echo "Go files are not formatted. Run 'gofmt -w .' to fix them."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Go Vet
|
|
run: go vet ./...
|
|
|
|
- name: Go Vulnerability Check
|
|
run: go tool govulncheck ./...
|
|
|
|
- name: Gosec Security Scanner
|
|
run: go tool gosec -exclude=G204,G304,G402 -exclude-generated -exclude-dir=cmd ./...
|
|
|
|
- name: Static Check
|
|
run: go tool staticcheck -checks="all,-ST1000,-ST1003,-ST1016,-ST1020,-ST1021,-ST1022,-SA1019,-SA9005" ./...
|