Skip to content

Commit 85037eb

Browse files
authored
Merge pull request #4 from JoelSpeed/actions
Add actions to build, test and lint
2 parents e990ae0 + 2e6288c commit 85037eb

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.github/workflows/go.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Go
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
name: Test
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Setup Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: '1.23.x'
19+
- name: Verify Vendoring
20+
run: make verify-vendor
21+
- name: Build
22+
run: make build
23+
- name: Build GolangCI-Lint
24+
run: make build-golangci
25+
- name: Test
26+
run: make test

.github/workflows/golangci-lint.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
11+
# pull-requests: read
12+
13+
jobs:
14+
golangci:
15+
name: lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version: stable
22+
- name: golangci-lint
23+
uses: golangci/golangci-lint-action@v6
24+
with:
25+
version: v1.62

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ lint: ## Run golangci-lint over the codebase.
4646
.PHONY: test
4747
test: fmt vet unit ## Run tests.
4848

49+
.PHONY: unit
50+
unit: ## Run unit tests.
51+
go test ./...
52+
4953
##@ Build
5054

5155
.PHONY: build
@@ -55,3 +59,8 @@ build: fmt vet ## Build KAL binary.
5559
.PHONY: build-golangci
5660
build-golangci: ## Run golangci-lint over the codebase.
5761
${GOLANGCI_LINT} custom
62+
63+
.PHONY: verify-%
64+
verify-%:
65+
make $*
66+
git diff --exit-code

0 commit comments

Comments
 (0)