restructure and adding functionality
This commit is contained in:
53
action.yaml
53
action.yaml
@@ -1,27 +1,46 @@
|
||||
name: "donotpassgo"
|
||||
description: "general go code checks"
|
||||
description: "go security checks and unit tests"
|
||||
inputs:
|
||||
test:
|
||||
description: "runs unit tests with specified library"
|
||||
test-library: #TEST_LIBRARY
|
||||
description: "if set, tests are run with the specific library (standard|ginkgo)"
|
||||
required: false
|
||||
default: "none"
|
||||
test-version: #TEST_VERSION
|
||||
description: "the test library version, if the version is none or standard this value is ignored"
|
||||
required: false
|
||||
default: "latest"
|
||||
test-fail: #TEST_FAIL
|
||||
description: "override switch to prevent jobs from failing when unit tests do"
|
||||
required: false
|
||||
default: "yes"
|
||||
static: #STATIC_FLAG
|
||||
description: "if set, static code checks are ran with gosec (yes|no)"
|
||||
required: false
|
||||
default: "yes"
|
||||
static-fail: #STATIC_FAIL
|
||||
description: "override switch to prevent jobs from failing when static code analysis does"
|
||||
required: false
|
||||
default: "yes"
|
||||
vulnerability: #VULN_CHECK
|
||||
description: "if set, dependencies are scanned with govulncheck (yes|no)"
|
||||
required: false
|
||||
default: "yes"
|
||||
vulnerability-fail: #VULN_FAIL
|
||||
description: "override switch to prevent jobs from failing when vulnerability scan does"
|
||||
required: false
|
||||
default: "yes"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "install dependencies"
|
||||
shell: bash
|
||||
run: ${{ github.action_path }}/src/install.sh
|
||||
|
||||
- name: "run unit tests"
|
||||
shell: bash
|
||||
run: ${{ github.action_path }}/test.sh
|
||||
env:
|
||||
LIBRARY: ${{ inputs.test }}
|
||||
run: ${{ github.action_path }}/src/test.sh
|
||||
|
||||
- name: "install govulncheck"
|
||||
run: |
|
||||
go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
|
||||
- name: "dependency scan"
|
||||
run: govulncheck ./...
|
||||
|
||||
- name: "static code analysis"
|
||||
uses: securego/gosec@master
|
||||
with:
|
||||
args: ./...
|
||||
- name: "run security checks"
|
||||
shell: bash
|
||||
run: ${{ github.action_path }}/src/security.sh
|
||||
Reference in New Issue
Block a user