Add CI linting/formatting #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: lint | |
on: [pull_request, workflow_dispatch] | |
jobs: | |
lua: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check formatting | |
uses: JohnnyMorganz/stylua-action@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
version: latest | |
args: --check . | |
go: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22 | |
- name: Go vet (vulnerabilities) | |
run: go vet ./... | |
working-directory: ./tests/go | |
# FIXME: figure out why this is crashing with: Error: StdIn:1:1: expected 'package', found 'EOF' | |
- name: Run gci (imports) | |
run: | | |
go install github.com/daixiang0/gci@latest | |
gci diff --skip-generated --skip-vendor -s standard -s default . | |
working-directory: ./tests/go | |
- name: Run golines (formatting) | |
run: | | |
go install mvdan.cc/gofumpt@latest | |
go install github.com/segmentio/golines@latest | |
golines --base-formatter=gofumpt --ignore-generated --tab-len=1 --max-len=120 . | |
working-directory: ./tests/go |