Skip to content

Commit

Permalink
Merge pull request #197 from henrybear327/ci/tests
Browse files Browse the repository at this point in the history
[CI] Introduce test pipeline
  • Loading branch information
azimjohn authored Apr 5, 2024
2 parents 4f8f210 + a7b245b commit 38f60f3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/tests.yaml
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
26 changes: 26 additions & 0 deletions Makefile
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

0 comments on commit 38f60f3

Please sign in to comment.