chore: fix some warnings for GitHub Actions

This commit is contained in:
Andy Pan 2024-04-15 18:07:18 +08:00
parent 9df33f340c
commit 83817c11bb
2 changed files with 7 additions and 16 deletions

View File

@ -32,7 +32,7 @@ jobs:
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
# Drafts your next Release notes as Pull Requests are merged into "master" # Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5 - uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with: # with:
# config-name: my-config.yml # config-name: my-config.yml

View File

@ -36,18 +36,19 @@ jobs:
name: Run golangci-lint name: Run golangci-lint
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '^1.16' go-version: '^1.16'
cache: false
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup and run golangci-lint - name: Setup and run golangci-lint
uses: golangci/golangci-lint-action@v3 uses: golangci/golangci-lint-action@v4
with: with:
version: v1.55.2 version: v1.57.2
args: --timeout 5m -v -E gofumpt -E gocritic -E misspell -E revive -E godot args: --timeout 5m -v -E gofumpt -E gocritic -E misspell -E revive -E godot
test: test:
needs: lint needs: lint
@ -82,16 +83,6 @@ jobs:
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "GO_CACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT echo "GO_CACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT
- name: Cache go modules
uses: actions/cache@v4
with:
path: |
${{ steps.go-env.outputs.GO_CACHE }}
~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.go }}-go-ci-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ matrix.go }}-go-ci
- name: Run unit tests and integrated tests - name: Run unit tests and integrated tests
run: go test -v -race -coverprofile="codecov.report" -covermode=atomic run: go test -v -race -coverprofile="codecov.report" -covermode=atomic