-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from project-ncl/add-go-lint-and-renovate
Improve go CI.
- Loading branch information
Showing
104 changed files
with
110,643 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: GoLang CI | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: './go.mod' | ||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
args: "--timeout=10m --build-tags='normal periodic minikube'" | ||
go: | ||
name: Check sources | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: './go.mod' | ||
- name: Check go mod status | ||
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 | ||
run: | | ||
go fmt ./cmd/... ./pkg/... | ||
if [[ ! -z $(git status -s) ]] | ||
then | ||
echo "not all golang files properly gofmt'ed:" | ||
git --no-pager diff | ||
exit 1 | ||
fi | ||
unit: | ||
name: Golang Unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: './go.mod' | ||
- name: Build Domain Proxy Server | ||
run: go build -v -o bin/domainproxyserver cmd/server/main.go | ||
- name: Build Domain Proxy Client | ||
run: go build -v -o bin/domainproxyclient cmd/client/main.go | ||
- name: Test | ||
run: go test -v ./test | ||
- name: Codecov | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
security_scan: | ||
name: Security scan | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: './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/[email protected] | ||
with: | ||
# Path to SARIF file relative to the root of the repository | ||
sarif_file: results.sarif |
This file was deleted.
Oops, something went wrong.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.