Skip to content

Commit 14e2753

Browse files
committed
Enable lint check in actions
1 parent 94deae6 commit 14e2753

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed
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 requests. 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@v5
19+
- uses: actions/setup-go@v6
20+
with:
21+
go-version: stable
22+
- name: golangci-lint
23+
uses: golangci/golangci-lint-action@v8
24+
with:
25+
version: v2.1

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ endif
1717
.RECIPEPREFIX = >
1818
TAG :=
1919

20-
.PHONY: help test unit int release int_single
20+
.PHONY: help test unit int release int_single lint verify
2121

2222
help: ## Display this help section
2323
> @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-38s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
2424

2525
test: unit int ## Run all tests
26+
verify: lint test ## Run lint and all tests
2627

2728
covtest: covunit covint ## Run all tests with coverage
2829
> go tool covdata percent -i=$(OPENRUN_HOME)/coverage/client,$(OPENRUN_HOME)/coverage/unit,$(OPENRUN_HOME)/coverage/int
@@ -32,6 +33,9 @@ covtest: covunit covint ## Run all tests with coverage
3233
unit: ## Run unit tests
3334
> go test ./...
3435

36+
lint: ## Run lint
37+
> golangci-lint run
38+
3539
covunit: ## Run unit tests with coverage
3640
> rm -rf $(OPENRUN_HOME)/coverage/unit && mkdir -p $(OPENRUN_HOME)/coverage/unit
3741
> go test -coverpkg ./... ./... -args -test.gocoverdir="$(OPENRUN_HOME)/coverage/unit"

tests/test_basics.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ tests:
2626

2727
basic040:
2828
command: CL_CONFIG_FILE=config_basic_client_https.toml ../openrun app list /invalid # Test TLS
29-
stderr: "error: 404 page not found"
30-
exit-code: 1
29+
exit-code: 1 # error can be 404 (if mkcert is installed) or cert check failure (if no mkcert)
3130

3231
basic050:
3332
command: CL_CONFIG_FILE=config_basic_client_https_skip.toml ../openrun app list /invalid # TLS with skip_cert_check

0 commit comments

Comments
 (0)