mirror of
https://github.com/ivuorinen/go-test-sarif.git
synced 2026-01-26 11:14:00 +00:00
feat: add golangci-lint and restore megalinter config (#22)
* feat: add golangci-lint and restore megalinter config * chore: fix linting, go mod tidy * fix(ci): add golangci-lint action setup to test.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: tweaks * fix(ci): tweaks * fix(ci): disable go_golangci_lint in megalinter * chore: yamllint rules * chore(ci): tweak yml --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
8
.github/README.md
vendored
8
.github/README.md
vendored
@@ -73,6 +73,7 @@ Clone the repository and build the project:
|
||||
git clone https://github.com/ivuorinen/go-test-sarif-action.git
|
||||
cd go-test-sarif-action
|
||||
go build -o go-test-sarif ./cmd/main.go
|
||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
```
|
||||
|
||||
Run tests:
|
||||
@@ -81,6 +82,13 @@ Run tests:
|
||||
go test ./...
|
||||
```
|
||||
|
||||
Run linting:
|
||||
|
||||
```sh
|
||||
go vet ./...
|
||||
golangci-lint run
|
||||
```
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is licensed under the **MIT License**.
|
||||
|
||||
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@@ -1,3 +1,4 @@
|
||||
---
|
||||
name: Run Go Tests and Generate SARIF
|
||||
|
||||
on:
|
||||
@@ -23,6 +24,15 @@ jobs:
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
|
||||
- name: Install golangci-lint
|
||||
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: Run Linters
|
||||
run: |
|
||||
go vet ./...
|
||||
golangci-lint run
|
||||
- name: Run Go Tests
|
||||
shell: bash
|
||||
run: go test -json ./... > go-test-results.json
|
||||
|
||||
Reference in New Issue
Block a user