run gosec and staticcheck in ci
Some checks failed
CI / Tests (pull_request) Failing after 2m18s
CI / Style (pull_request) Failing after 8s

This commit is contained in:
Dan Anglin 2024-10-13 12:04:20 +01:00
parent ed5f62887c
commit f393d982f5
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
4 changed files with 29 additions and 7 deletions

View file

@ -1,5 +1,5 @@
---
name: Workflow
name: CI
on:
pull_request:
@ -8,12 +8,10 @@ on:
- synchronize
jobs:
test:
tests:
name: Tests
if: ${{ ! github.event.pull_request.draft }}
runs-on: docker
env:
GO_TEST_VERBOSE: "1"
GO_TEST_COVER: "1"
steps:
- name: Checkout Repository
uses: https://code.forgejo.org/actions/checkout@v4
@ -24,3 +22,19 @@ jobs:
env:
PROJECT_TEST_VERBOSE: "1"
PROJECT_TEST_COVER: "1"
- name: Gosec
uses: https://codeflow.dananglin.me.uk/actions/mage-ci@main
with:
target: gosec
style:
name: Style
if: ${{ ! github.event.pull_request.draft }}
runs-on: docker
steps:
- name: Checkout Repository
uses: https://code.forgejo.org/actions/checkout@v4
- name: Run staticcheck
uses: https://codeflow.dananglin.me.uk/actions/mage-ci@main
with:
target: staticcheck

View file

@ -52,6 +52,14 @@ func Lint() error {
return sh.RunV("golangci-lint", "run", "--color", "always")
}
func Gosec() error {
return sh.RunV("gosec", "./...")
}
func Staticcheck() error {
return sh.RunV("staticcheck", "./...")
}
// Build build the executable.
// To rebuild packages that are already up-to-date set PROJECT_BUILD_REBUILD_ALL=1
// To enable verbose mode set PROJECT_BUILD_VERBOSE=1