e2e-tests update #424
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate PR - golang CI | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 | |
with: | |
go-version-file: './task-generator/go.mod' | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@db819a10bda59ee2a8f342af52c07e329576a0f5 | |
with: | |
working-directory: task-generator | |
args: "--timeout=10m --build-tags='normal periodic'" | |
go: | |
name: Check sources | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- name: Install Go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 | |
with: | |
go-version-file: './task-generator/go.mod' | |
- name: Check go mod status | |
working-directory: task-generator | |
run: | | |
go mod tidy | |
if [[ ! -z $(git status -s) ]] | |
then | |
echo "Go mod state is not clean:" | |
git --no-pager diff | |
exit 1 | |
fi | |
- name: Check format | |
working-directory: task-generator | |
run: | | |
go fmt ./... | |
if [[ ! -z $(git status -s) ]] | |
then | |
echo "not all golang files properly gofmt'ed:" | |
git --no-pager diff | |
exit 1 | |
fi | |
security_scan: | |
name: Security scan | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 | |
with: | |
go-version-file: './task-generator/go.mod' | |
# https://github.com/securego/gosec/blob/12be14859bc7d4b956b71bef0b443694aa519d8a/README.md#integrating-with-code-scanning | |
- name: Run Gosec Security Scanner | |
uses: securego/gosec@master | |
with: | |
# we let the report trigger content trigger a failure using the GitHub Security features. | |
args: '-tags normal,periodic -no-fail -fmt sarif -out results.sarif ./...' | |
- name: Upload SARIF file | |
uses: github/codeql-action/upload-sarif@be825d5eefdb0c498fa30c4b57ec0690b4d0cecb | |
with: | |
# Path to SARIF file relative to the root of the repository | |
sarif_file: results.sarif |