refactor: upgrade to support Golang 1.22 (#319) #1302
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: CI AND IT | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- develop | |
- master | |
- release/* | |
pull_request: | |
jobs: | |
CI: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- name: Run Lint | |
uses: golangci/golangci-lint-action@v3 | |
- name: Run Test | |
run: | | |
echo $GOARCH | |
go test -cpu=2 -timeout 10s -race -coverprofile=coverage.txt -covermode=atomic ./... | |
bash <(curl -s https://codecov.io/bash) | |
CODE-CHECK: | |
runs-on: ubuntu-latest | |
container: | |
image: registry.erda.cloud/erda/erda-base:20240410 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run go mod tidy | |
run: make tidy | |
- name: Run Go Lint | |
run: | | |
go install github.com/golangci/golangci-lint/cmd/[email protected] | |
golangci-lint run --timeout=15m ./... | |
# - name: Run Go Vet | |
# run: go vet ./... |