-
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.
ci: add workflows to run lint, test and vulnerability check tasks
Signed-off-by: VirtualTam <[email protected]>
- Loading branch information
1 parent
a1941bb
commit 60152c4
Showing
5 changed files
with
96 additions
and
1 deletion.
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
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,42 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
pull_request: {} | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
args: --timeout=10m | ||
version: "v1.58" | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Test | ||
run: make cover |
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,23 @@ | ||
--- | ||
name: Copywrite | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
pull_request: {} | ||
|
||
jobs: | ||
copywrite: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install copywrite | ||
uses: hashicorp/[email protected] | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate license header compliance | ||
run: copywrite headers --plan |
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,24 @@ | ||
--- | ||
name: Vulnerabilities | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
pull_request: {} | ||
|
||
jobs: | ||
vulnerabilities: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: vulncheck | ||
id: govulncheck | ||
uses: golang/govulncheck-action@v1 | ||
with: | ||
# The setup-go action does not necessarily use the latest Go patch release. | ||
# As such, this job may fail due to vulnerabilities present in previous | ||
# patch releases (including the one used by the setup-go action). | ||
# See https://github.com/actions/setup-go/issues/407 | ||
go-version-file: go.mod |
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