From d4e3b37e912aadb975148c7cd6247835477a5db1 Mon Sep 17 00:00:00 2001 From: lab-code-heavy Date: Mon, 23 Feb 2026 21:10:03 -0600 Subject: [PATCH] CI: improve workflow (checkout v3, setup-go v4, cache, fmt/vet) --- .gitea/workflows/ci.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 13e370a..ff4f37a 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -7,11 +7,27 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: '1.20' + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Tidy modules + run: go mod tidy + - name: Format check + run: | + gofmt_out=$(gofmt -l . | wc -l); if [ "$gofmt_out" -ne "0" ]; then echo "gofmt needs to be run"; gofmt -w .; exit 1; fi + - name: Vet + run: go vet ./... - name: Build run: make build - name: Test