-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (60 loc) · 1.93 KB
/
build.yaml
File metadata and controls
78 lines (60 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Run tests with coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
REGISTRY: ghcr.io
jobs:
validate_commit:
name: Validate commit
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/main' }}
steps:
- uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6.2.0
with:
go-version: '1.25.*'
- uses: extractions/setup-just@v3
- name: Check Format
run: gofmt -d ./
- name: Verify dependencies
run: go mod verify
- name: Install dependencies
run: go mod vendor
- name: Run go vet
run: go vet ./...
- name: Build
run: go build -v ./...
- name: Lint
uses: golangci/golangci-lint-action@v9
- name: Run unit tests
run: go test -v ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... -short
- name: Check test coverage
id: coverage
uses: vladopajic/go-test-coverage@v2
continue-on-error: true # Should fail after coverage comment is posted
with:
config: .testcoverage.yaml
- name: Post coverage report
uses: thollander/actions-comment-pull-request@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-tag: coverage-report
message: |
go-test-coverage report:
```${{ fromJSON(steps.coverage.outputs.report) }}```
- name: Finally check coverage
if: steps.coverage.outcome == 'failure'
shell: bash
run: echo "coverage check failed" && exit 1
- name: Setup integration tests
run: just up
- name: Run integration tests
run: go test -v ./tests/... -count=1 -kubeconfig-cmd "kind get kubeconfig" -timeout 3m
- name: Get logs from application pods
if: always()
run: |
kubectl describe pods --namespace default || true