Skip to content

Commit

Permalink
GH: Add basic GH Actions workflow for code quality
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
briancain committed Feb 7, 2024
1 parent 3cdfc6e commit 8f29951
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

# Disabling linter for now. Will enable when project is finished, so
# all of the errors can be fixed in a single pass
#- name: golangci-lint
# uses: golangci/golangci-lint-action@v3
# with:
# # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
# version: latest
# args: --build-tags="$GOTAGS" --concurrency 2 --timeout 10m

- name: go mod tidy check
run: |
go mod tidy
git diff --exit-code -- go.mod go.sum
- name: Lint # Check syntax with the linter
run: make go/lint

- name: Test # Run the golang tests!
run: make test

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ go/mocks: ## Generates Go mock files.
mockery; \
done

.PHONY: test
test: ## Run the unit tests
@go test -v -cover ./...

HELP_FORMAT=" \033[36m%-25s\033[0m %s\n"
.PHONY: help
help: ## Display this usage information
Expand Down

0 comments on commit 8f29951

Please sign in to comment.