mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
83 lines
1.7 KiB
YAML
83 lines
1.7 KiB
YAML
name: PR
|
|
|
|
on:
|
|
pull_request: { }
|
|
|
|
jobs:
|
|
lint:
|
|
name: Linter
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Run go generate
|
|
run: go generate ./...
|
|
|
|
- name: Golangci Lint
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: v2.10.1
|
|
|
|
# TODO: Remove once linter is properly configured
|
|
fmt-check:
|
|
name: Formatting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Check formatting
|
|
run: |
|
|
make fmt
|
|
git diff --exit-code || (echo "::error::Code is not formatted. Run 'make fmt' and commit the changes." && exit 1)
|
|
|
|
# TODO: Remove once linter is properly configured
|
|
vet:
|
|
name: Vet
|
|
runs-on: ubuntu-latest
|
|
needs: fmt-check
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Run go generate
|
|
run: go generate ./...
|
|
|
|
- name: Run go vet
|
|
run: go vet ./...
|
|
|
|
test:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
needs: fmt-check
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Run go generate
|
|
run: go generate ./...
|
|
|
|
- name: Run go test
|
|
run: go test ./...
|