name: Backend CI on: push: branches: [main, develop] pull_request: branches: [main, develop] jobs: test: name: Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true - name: Download dependencies run: go mod download - name: Run tests run: go test -race -count=1 ./... - name: Run contract validation run: go test -v -run "TestRouteSpecContract|TestKMPSpecContract" ./internal/integration/ build: name: Build runs-on: ubuntu-latest needs: test steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true - name: Build API run: go build -ldflags "-s -w" -o bin/casera-api ./cmd/api - name: Build Worker run: go build -ldflags "-s -w" -o bin/casera-worker ./cmd/worker lint: name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true - name: Run go vet run: go vet ./... - name: Check formatting run: | unformatted=$(gofmt -l .) if [ -n "$unformatted" ]; then echo "Unformatted files:" echo "$unformatted" exit 1 fi