mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-23 04:36:40 +00:00
62 lines
1.4 KiB
YAML
62 lines
1.4 KiB
YAML
name: Hive Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
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" ./...
|