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:
parent
7885fb7422
commit
5c46fdf48b
|
@ -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
|
Loading…
Reference in New Issue