Skip to content

Commit

Permalink
Add CI pipeline
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
ronny committed Apr 25, 2024
1 parent 4884dee commit 9ffedcf
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: tests

on:
push:
workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- run: make ci-test
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
all: test

test:
go test -v -shuffle=on -coverprofile=coverage.txt -count=1 ./...

vet:
go vet ./...

staticcheck:
staticcheck ./...

format:
gofumpt -l -w .

lint: vet staticcheck format

install-tools:
go install mvdan.cc/gofumpt@latest
go install honnef.co/go/tools/cmd/staticcheck@latest

ci-checks: lint
go mod tidy
git diff --exit-code

ci-test: install-tools ci-checks test

# Tell Make that these steps should always run, never cached, even if we have
# files with the same names as these in the filesystem.
.PHONY: all test vet staticcheck lint format mod-tidy ci-checks install-tools ci-test

0 comments on commit 9ffedcf

Please sign in to comment.