From 8260fcf5840f64966b20418bf20bfed011987f4c Mon Sep 17 00:00:00 2001 From: Campbell <58050615+NinjaCheetah@users.noreply.github.com> Date: Sun, 5 Apr 2026 21:53:04 -0400 Subject: [PATCH] (ci) Add lint workflow (#95) * (ci) Add lint workflow, update build workflow actions * (ci) Fixed golangci-lint version oops I accidentally confused the golintci-lint and go versions * (ci) Testing exclusions * Update .golangci.yml * Update .golangci.yml --- .github/workflows/build.yml | 10 +++++----- .github/workflows/golangci-lint.yml | 20 ++++++++++++++++++++ .golangci.yml | 13 +++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml create mode 100644 .golangci.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e970c6..5a55589 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,13 +11,13 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 with: go-version: stable - name: Install dependencies run: go mod download - - uses: goreleaser/goreleaser-action@v5 + - uses: goreleaser/goreleaser-action@v7 with: distribution: goreleaser version: latest @@ -32,7 +32,7 @@ jobs: id: short-sha run: echo "SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: wfc-server-${{ steps.short-sha.outputs.SHA }} - path: ./dist/*/* \ No newline at end of file + path: ./dist/*/* diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..65dba15 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,20 @@ +name: golangci-lint +on: + [push, pull_request] + +permissions: + contents: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 + with: + go-version: stable + - name: golangci-lint + uses: golangci/golangci-lint-action@v9 + with: + version: v2.11 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..3ca5499 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,13 @@ +version: "2" +linters: + exclusions: + paths: + - "nhttp/ascii.go" + - "nhttp/buffer.go" + - "nhttp/chunked.go" + - "nhttp/errors.go" + - "nhttp/handler.go" + - "nhttp/request.go" + - "nhttp/response.go" + - "nhttp/server.go" + - "nhttp/transfer.go"