From 5c46fdf48bcd09f512b30e85c41bf3e24fa74483 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 16 Feb 2024 10:53:35 +0800 Subject: [PATCH] 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 --- .gitea/workflows/{test.yml => testing.yml} | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) rename .gitea/workflows/{test.yml => testing.yml} (57%) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/testing.yml similarity index 57% rename from .gitea/workflows/test.yml rename to .gitea/workflows/testing.yml index b551a45..d31218a 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/testing.yml @@ -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