create bundle repos automatically if missing #2647
Workflow file for this run
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 | |
strategy: | |
matrix: | |
path: | |
- task-generator/remote | |
- task-generator/trusted-artifacts | |
steps: | |
- uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb | |
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed | |
with: | |
go-version-file: './${{matrix.path}}/go.mod' | |
cache-dependency-path: ./${{matrix.path}}/go.sum | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@160a1d779cee256901ff3d68ef8ccc63ac8a04f8 | |
with: | |
working-directory: ${{matrix.path}} | |
args: "--timeout=10m --build-tags='normal periodic'" | |
go: | |
name: Check sources | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
path: | |
- task-generator/remote | |
- task-generator/trusted-artifacts | |
steps: | |
- uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb | |
- name: Install Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed | |
with: | |
go-version-file: './${{matrix.path}}/go.mod' | |
cache-dependency-path: ./${{matrix.path}}/go.sum | |
- name: Check go mod status | |
working-directory: ${{matrix.path}} | |
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: ${{matrix.path}} | |
run: | | |
go fmt ./... | |
if [[ ! -z $(git status -s) ]] | |
then | |
echo "not all golang files properly gofmt'ed:" | |
git --no-pager diff | |
exit 1 | |
fi | |
- name: Tests | |
working-directory: ${{matrix.path}} | |
run: | | |
go test ./... | |
security_scan: | |
name: Security scan | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
path: | |
- task-generator/remote | |
- task-generator/trusted-artifacts | |
steps: | |
- uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb | |
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed | |
with: | |
go-version-file: './${{matrix.path}}/go.mod' | |
cache-dependency-path: ./${{matrix.path}}/go.sum | |
# 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 ${{matrix.path}}/...' | |
- name: Upload SARIF file | |
uses: github/codeql-action/upload-sarif@a6c8729a5d7573eb8d440e52a9645ce4db61d97c | |
with: | |
# Path to SARIF file relative to the root of the repository | |
sarif_file: results.sarif |