Skip to content

Commit a46af5f

Browse files
JoshVanLartursouza
andauthored
Remove nix (#16)
* Remove nix Signed-off-by: joshvanl <[email protected]> * Fix workflow file by separating `uses` and `runs` Signed-off-by: joshvanl <[email protected]> * Update workflow target branch main -> master Signed-off-by: joshvanl <[email protected]> * Add Makefile back Signed-off-by: Artur Souza <[email protected]> * Use less strict lint settings. Signed-off-by: Artur Souza <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Signed-off-by: Artur Souza <[email protected]> Co-authored-by: Artur Souza <[email protected]>
1 parent 7d28278 commit a46af5f

File tree

6 files changed

+79
-458
lines changed

6 files changed

+79
-458
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4
10-
- uses: cachix/install-nix-action@v26
10+
- uses: actions/setup-go@v5
11+
- uses: golangci/[email protected]
1112
with:
12-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
13-
- run: nix flake check
14-
- run: nix run .#test
13+
version: v1.55.2
14+
- run: go test -v --race ./...

Makefile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
################################################################################
2+
# Target: lint #
3+
################################################################################
4+
# Please use golangci-lint with matching version, otherwise you might encounter errors.
5+
# You can download at https://github.com/golangci/golangci-lint/releases/
6+
# Check .github/wortkflows/test.yaml for the version used in GitHub actions.
7+
8+
ifeq ($(GOOS),windows)
9+
GOLANGCI_LINT:=golangci-lint.exe
10+
else
11+
GOLANGCI_LINT:=golangci-lint
12+
endif
13+
14+
.PHONY: lint
15+
lint:
16+
$(GOLANGCI_LINT) run --timeout=20m
17+
18+
19+
################################################################################
20+
# Target: check-linter #
21+
################################################################################
22+
.SILENT: check-linter # Silence output other than the application run
23+
.PHONY: check-linter
24+
check-linter:
25+
$(RUN_BUILD_TOOLS) check-linter
26+
27+
28+
################################################################################
29+
# Target: modtidy #
30+
################################################################################
31+
.PHONY: modtidy
32+
modtidy:
33+
go mod tidy
34+
35+
################################################################################
36+
# Target: gen-proto #
37+
################################################################################
38+
PROTOC ?=protoc
39+
PROTOC_VERSION = 24.4
40+
PROTOBUF_SUITE_VERSION = 24.4
41+
PROTOC_GEN_GO_VERSION = v1.32.0
42+
43+
PROTOC_GEN_GO_GRPC_VERSION = 1.3.0
44+
45+
PROTOS:=$(shell ls proto)
46+
PROTO_PREFIX:=github.com/diagridio/go-etcd-cron
47+
48+
.PHONY: check-proto-version
49+
check-proto-version: ## Checking the version of proto related tools
50+
@test "$(shell protoc --version)" = "libprotoc $(PROTOC_VERSION)" \
51+
|| { echo "please use protoc $(PROTOC_VERSION) (protobuf $(PROTOBUF_SUITE_VERSION)) to generate proto"; exit 1; }
52+
53+
@test "$(shell protoc-gen-go-grpc --version)" = "protoc-gen-go-grpc $(PROTOC_GEN_GO_GRPC_VERSION)" \
54+
|| { echo "please use protoc-gen-go-grpc $(PROTOC_GEN_GO_GRPC_VERSION) to generate proto"; exit 1; }
55+
56+
@test "$(shell protoc-gen-go --version 2>&1)" = "protoc-gen-go $(PROTOC_GEN_GO_VERSION)" \
57+
|| { echo "please use protoc-gen-go $(PROTOC_GEN_GO_VERSION) to generate proto"; exit 1; }
58+
59+
# Generate archive files for each binary
60+
# $(1): the binary name to be archived
61+
define genProtoc
62+
.PHONY: gen-proto-$(1)
63+
gen-proto-$(1):
64+
$(PROTOC) --go_out=. --go_opt=module=$(PROTO_PREFIX) --go-grpc_out=. --go-grpc_opt=require_unimplemented_servers=false,module=$(PROTO_PREFIX) ./proto/$(1)/*
65+
endef
66+
67+
$(foreach ITEM,$(PROTOS),$(eval $(call genProtoc,$(ITEM))))
68+
69+
GEN_PROTOS:=$(foreach ITEM,$(PROTOS),gen-proto-$(ITEM))
70+
71+
.PHONY: gen-proto
72+
gen-proto: check-proto-version $(GEN_PROTOS) modtidy
73+
74+
test:
75+
go test -timeout 300s --race ./...

flake.lock

Lines changed: 0 additions & 115 deletions
This file was deleted.

flake.nix

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)