-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #197 from henrybear327/ci/tests
[CI] Introduce test pipeline
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: Tests | ||
on: [push, pull_request] | ||
permissions: | ||
contents: read | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
- uses: actions/checkout@v4 | ||
- name: tests | ||
run: | | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
NAME ?= jprq | ||
PKG ?= github.com/azimjohn/$(NAME) | ||
GO_VERSION ?= 1.22.2 | ||
GOOS ?= linux | ||
GOARCH ?= amd64 | ||
TEMP_DIR := $(shell mktemp -d) | ||
GOFILES = $(shell find . -name \*.go) | ||
|
||
.PHONY: fmt | ||
fmt: | ||
@echo "Verifying gofmt" | ||
@!(gofmt -l -s -d ${GOFILES} | grep '[a-z]') | ||
|
||
@echo "Verifying goimports" | ||
@!(go run golang.org/x/tools/cmd/goimports@latest -l -d ${GOFILES} | grep '[a-z]') | ||
|
||
.PHONY: verify | ||
verify: | ||
golangci-lint run --config tools/.golangci.yaml ./... | ||
|
||
.PHONY: test | ||
test: | ||
@echo Vetting | ||
go vet ./... | ||
@echo Testing | ||
go test ./... -skip TestConfig_Load |