ci: refactor GitHub Actions workflows and dependencies

- Rename GitHub Actions workflow file from `test.yml` to `testing.yml`
- Change workflow job name from `checks` to `testing`
- Update GitHub Actions `checkout` to version 4
- Remove specific Go version in favor of determining it from `go.mod`
- Update GitHub Actions `setup-go` to version 5
- Update GitHub Actions `cache` to version 4
- Add `golangci-lint` action with specified version and timeout arguments

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2024-02-16 10:53:35 +08:00
parent 7885fb7422
commit 5c46fdf48b
No known key found for this signature in database
1 changed files with 12 additions and 5 deletions

View File

@ -1,4 +1,4 @@
name: checks
name: testing
on:
- push
- pull_request
@ -12,10 +12,12 @@ jobs:
name: check and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
with:
go-version: '>=1.20.1'
fetch-depth: 0 # all history for all branches and tags
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go
with:
@ -24,9 +26,14 @@ jobs:
go.sum
- name: cache go
id: cache-go
uses: https://github.com/actions/cache@v3
uses: actions/cache@v4
with:
path: |
/go_path
/go_cache
key: go_path-${{ steps.hash-go.outputs.hash }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.56.2
args: --timeout 5m