mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
chore: update CI, golangci-lint, and CLAUDE.md (#511)
* chore: update CI, golangci-lint, and CLAUDE.md * fix: resolve CI failures on Windows test and lint * fix: resolve Windows test path and main.go line length lint issues * fix: auto-format log/ with gofumpt, exclude pre-refactoring lint issues * fix: resolve remaining lint issues, remove unnecessary exclusions * fix: remove invalid G117 gosec rule, use text exclusion for secret pattern * fix: align CI golangci-lint version with local (v2.4 -> v2.10)
This commit is contained in:
@@ -7,6 +7,9 @@ on:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build on ${{ matrix.os }}
|
||||
@@ -14,38 +17,12 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
goVer: ["1.20.x"]
|
||||
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go ${{ matrix.goVer }}
|
||||
uses: actions/setup-go@v5
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: ${{ matrix.goVer }}
|
||||
cache: false
|
||||
id: go
|
||||
|
||||
- name: cache go modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
~/.cache/go-build
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Format Check
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: |
|
||||
diff -u <(echo -n) <(gofmt -d .)
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go mod tidy
|
||||
go mod download
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Build
|
||||
run: go build -v ./...
|
||||
|
||||
+10
-14
@@ -5,31 +5,27 @@ on:
|
||||
- main
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Set Golang
|
||||
uses: actions/setup-go@v5
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.20.x"
|
||||
cache: false
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Check spelling with custom config file
|
||||
- name: Check spelling
|
||||
uses: crate-ci/typos@master
|
||||
with:
|
||||
config: ./.typos.toml
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go mod tidy
|
||||
go mod download
|
||||
|
||||
- name: Lint
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v8
|
||||
with:
|
||||
version: v2.4.0
|
||||
version: v2.10
|
||||
|
||||
@@ -11,16 +11,16 @@ jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.20.x'
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
|
||||
+23
-31
@@ -1,51 +1,43 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test (${{ matrix.os }})
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ "1.20.x" ]
|
||||
platform: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Install Go
|
||||
if: success()
|
||||
uses: actions/setup-go@v5
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Run tests
|
||||
run: go test -v ./... -covermode=count
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: go test -v ./...
|
||||
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
if: success()
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.20.x"
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Calc coverage
|
||||
run: |
|
||||
go test -v ./... -covermode=count -coverprofile=coverage.out
|
||||
- name: Run tests with coverage
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: go test -v -coverprofile=coverage.out ./...
|
||||
|
||||
- name: Convert coverage.out to coverage.lcov
|
||||
uses: jandelgado/gcov2lcov-action@v1
|
||||
- name: Coveralls
|
||||
uses: coverallsapp/github-action@v2
|
||||
- name: Upload coverage
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
github-token: ${{ secrets.github_token }}
|
||||
path-to-lcov: coverage.lcov
|
||||
use_oidc: true
|
||||
files: ./coverage.out
|
||||
fail_ci_if_error: false
|
||||
flags: unittests
|
||||
|
||||
Reference in New Issue
Block a user