This commit updates the go-grip project to use golangci-lint for code quality checks, improves the build process by adding a check for formatting errors, and enhances the release workflow by using the new golangci-lint action. The changes address issues with code quality and maintainability, ensuring that the project adheres to best practices. The improved build process reduces the risk of formatting errors, while the updated release workflow ensures that the project is properly formatted before being released.
37 lines
614 B
YAML
37 lines
614 B
YAML
name: Build
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 1.22
|
|
|
|
- name: Build
|
|
run: make build
|
|
|
|
- name: Run tests
|
|
run: make test
|
|
|
|
- name: Format
|
|
run: |
|
|
DIFF="$(gofmt -d .)"
|
|
if [[ -n $DIFF ]]; then
|
|
echo "$DIFF"
|
|
echo "please run gofmt"
|
|
exit 1
|
|
fi
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: v1.60
|