Skip to content

Commit 21da5dd

Browse files
committed
chore: add GH CI workflows
Signed-off-by: Fred Rolland <frolland@nvidia.com>
1 parent 7921065 commit 21da5dd

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

.github/workflows/checks.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "Checks"
2+
on: [push, pull_request]
3+
4+
jobs:
5+
lint-code:
6+
name: golangci-lint
7+
runs-on: ubuntu-24.04
8+
permissions:
9+
contents: read
10+
steps:
11+
- name: Set up Go 1.x
12+
uses: actions/setup-go@v5
13+
with:
14+
go-version: '1.24.x'
15+
- name: checkout
16+
uses: actions/checkout@v5
17+
- name: lint
18+
working-directory: ./entrypoint
19+
run: make lint
20+
diff-modules:
21+
name: check go modules
22+
runs-on: ubuntu-24.04
23+
permissions:
24+
contents: read
25+
steps:
26+
- name: Set up Go 1.x
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: '1.24.x'
30+
- name: checkout
31+
uses: actions/checkout@v5
32+
- name: check go modules
33+
working-directory: ./entrypoint
34+
run: make check-go-modules
35+
unit-tests:
36+
name: Unit-tests
37+
runs-on: ubuntu-24.04
38+
permissions:
39+
contents: read
40+
steps:
41+
- name: Set up Go 1.x
42+
uses: actions/setup-go@v5
43+
with:
44+
go-version: '1.24.x'
45+
- name: checkout
46+
uses: actions/checkout@v5
47+
- name: test
48+
working-directory: ./entrypoint
49+
run: make unit-test
50+
- name: Generate LCOV report
51+
working-directory: ./entrypoint
52+
run: |
53+
go install github.com/jandelgado/gcov2lcov@latest
54+
gcov2lcov -infile=cover.out -outfile=coverage.lcov
55+
- name: Upload coverage to Coveralls
56+
uses: coverallsapp/github-action@v2.3.6
57+
with:
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
path-to-lcov: entrypoint/coverage.lcov

entrypoint/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,11 @@ generate-mocks: mockery ## generate mock objects
107107
.PHONY: build
108108
build: $(BUILDDIR) ## Build manager binary.
109109
$(GO_BUILD_OPTS) go build -ldflags $(GO_LDFLAGS) -gcflags="$(GO_GCFLAGS)" -o $(BUILDDIR)/entrypoint cmd/main.go
110+
111+
.PHONY: check-go-modules
112+
check-go-modules: generate-go-modules
113+
git diff --quiet HEAD go.sum; if [ $$? -eq 1 ] ; then echo "go.sum is out of date. Please commit after running 'make generate-go-modules' command"; exit 1; fi
114+
115+
.PHONY: generate-go-modules
116+
generate-go-modules:
117+
go mod tidy

0 commit comments

Comments
 (0)