-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: gang.liu <[email protected]>
- Loading branch information
Showing
2 changed files
with
50 additions
and
19 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 |
---|---|---|
@@ -1,33 +1,64 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
name: Contour plugin CI | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: | ||
- "main" | ||
env: | ||
GOLANG_VERSION: '1.21' | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit tests running | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
|
||
build: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Unit tests running | ||
run: | | ||
go test -v ./... | ||
linting: | ||
name: Go code linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Lint | ||
# https://golangci-lint.run/ | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
args: --issues-exit-code=0 --timeout 10m | ||
- name: Run golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
args: --verbose --timeout 6m | ||
|
||
build: | ||
name: Build creation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
|
||
- name: Build | ||
run: make build | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Build creation | ||
run: | | ||
go build -v |
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