Files
pulse-api/.gitea/workflows/ci.yml
Cosmo 30a894a78f
Some checks failed
CI / lint-test (push) Failing after 2m9s
CI / lint-test (pull_request) Failing after 25s
ci: add lint, coverage check and proper deploy workflow
2026-03-26 18:33:43 +00:00

38 lines
838 B
YAML

name: CI
on:
push:
branches-ignore: [main]
pull_request:
branches: [main]
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Tidy
run: go mod tidy
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: Test
run: go test ./... -coverprofile=coverage.out -covermode=atomic
- name: Coverage Check
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | tr -d '%')
echo "Coverage: ${COVERAGE}%"
if (( $(echo "$COVERAGE < 85" | bc -l) )); then
echo "::error::Coverage ${COVERAGE}% is below 85%"
exit 1
fi