Skip to content

Add mock interface and avoid validating tokens (#178) #9

Add mock interface and avoid validating tokens (#178)

Add mock interface and avoid validating tokens (#178) #9

Workflow file for this run

name: Validate PRs
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Setup Go environment
uses: actions/setup-go@v2.1.3
with:
go-version: 1.19
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check go mod status
run: |
make gomod_tidy
if [[ ! -z $(git status -s) ]]
then
echo "Go mod state is not clean"
git diff "$GITHUB_SHA"
exit 1
fi
- name: Build Binary
run: make bin
- name: Check format
run: |
make gofmt
if [[ ! -z $(git status -s) ]]
then
echo "not well formatted sources are found : $(git status -s)"
exit 1
fi
- name: Check license
run: |
go install github.com/google/addlicense@latest
git reset HEAD --hard
make check_license
if [[ $? != 0 ]]
then
echo "not well formatted sources are found:"
git --no-pager diff
exit 1
fi
- name: Run Go Tests
run: make test
- name: Run Gosec Security Scanner
run: |
go install github.com/securego/gosec/v2/cmd/gosec@v2.14.0
make gosec
if [[ $? != 0 ]]
then
echo "gosec scanner failed to run "
exit 1
fi
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: gosec.sarif
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.1.0