mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 04:01:34 +00:00
- Add comprehensive GitHub Actions workflows for Go backend - Build workflow with binary compilation and attestation - Test workflow with coverage reporting and race detection - Lint workflow with golangci-lint and security scanning - Docker build workflow with multi-architecture support - Deploy workflow for production deployment - Security workflow with vulnerability scanning - All workflows follow Single Responsibility Principle - Use semantic versioning and latest action versions - Enable security features: OIDC auth, attestations, minimal permissions
47 lines
988 B
YAML
47 lines
988 B
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
pull_request:
|
|
branches: [main, develop]
|
|
|
|
jobs:
|
|
build-binary:
|
|
name: Build Binary
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
attestations: write
|
|
id-token: write
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: "1.25"
|
|
cache: true
|
|
|
|
- name: Install dependencies
|
|
run: go mod download
|
|
|
|
- name: Verify dependencies
|
|
run: go mod verify
|
|
|
|
- name: Build application
|
|
run: |
|
|
go build -v -o bin/tercul-backend ./cmd
|
|
ls -la bin/
|
|
|
|
- name: Test binary
|
|
run: ./bin/tercul-backend --help || echo "Binary built successfully"
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: tercul-backend-binary
|
|
path: bin/
|
|
retention-days: 30
|