-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: refine github action ci and use the latest go version
- Loading branch information
Showing
2 changed files
with
41 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,6 +1,15 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
on: [ | ||
push, | ||
pull_request | ||
] | ||
|
||
env: | ||
GO_VERSION: "1.21" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
typos-check: | ||
|
@@ -11,8 +20,9 @@ jobs: | |
uses: actions/checkout@v3 | ||
- name: Check spelling with custom config file | ||
uses: crate-ci/[email protected] | ||
linter: | ||
name: linter | ||
|
||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
|
@@ -21,29 +31,32 @@ jobs: | |
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.18.4" | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3.3.0 | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.50.0 | ||
args: --timeout 10m0s | ||
version: v1.54 | ||
# '-v' flag is required to show the output of golangci-lint. | ||
args: -v | ||
|
||
unit-test: | ||
name: coverage-test | ||
runs-on: ubuntu-latest | ||
needs: [ linter ] | ||
needs: [ lint ] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.18.4" | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Unit test | ||
run: | | ||
make coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
|
@@ -52,19 +65,19 @@ jobs: | |
files: ./coverage.xml | ||
name: codecov-gtctl | ||
verbose: true | ||
e2e-test: | ||
name: e2e-test | ||
e2e: | ||
name: e2e | ||
runs-on: ubuntu-latest | ||
needs: [ linter ] | ||
needs: [ lint ] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.18.4" | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: e2e test of basic cluster | ||
- name: Run e2e | ||
run: | | ||
make e2e |
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