- Added .github/workflows/go-test.yml for automated CI testing using GitHub Actions - Implemented unit tests for: • utils/release.go (FetchLatestRelease) • routes/builds.go (buildsHandler) • routes/status.go (statusHandler) - Ensured tests run with go test ./... -v -cover - Included go vet and gofmt checks in the CI pipeline - Improved project reliability and continuous integration setup
32 lines
586 B
YAML
32 lines
586 B
YAML
name: Go CI - Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master, dev ]
|
|
pull_request:
|
|
branches: [ main, master, dev ]
|
|
|
|
jobs:
|
|
test:
|
|
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.25'
|
|
|
|
- name: Install dependencies
|
|
run: go mod download
|
|
|
|
- name: Run unit tests
|
|
run: go test ./... -v -cover
|
|
|
|
- name: Run vet & lint checks
|
|
run: |
|
|
go vet ./...
|
|
test -z "$(gofmt -l .)"
|