From 0c3726829fd986cefde92618c6358211889f2849 Mon Sep 17 00:00:00 2001 From: hangpersonal Date: Mon, 20 Oct 2025 22:59:23 -0700 Subject: [PATCH] Add .gitea/workflows/*.yaml --- .../{test-cache.yml => cache-go.yml} | 0 .gitea/workflows/cache-test.yml | 45 +++++++++++++++++++ 2 files changed, 45 insertions(+) rename .gitea/workflows/{test-cache.yml => cache-go.yml} (100%) create mode 100644 .gitea/workflows/cache-test.yml diff --git a/.gitea/workflows/test-cache.yml b/.gitea/workflows/cache-go.yml similarity index 100% rename from .gitea/workflows/test-cache.yml rename to .gitea/workflows/cache-go.yml diff --git a/.gitea/workflows/cache-test.yml b/.gitea/workflows/cache-test.yml new file mode 100644 index 0000000..8a91dff --- /dev/null +++ b/.gitea/workflows/cache-test.yml @@ -0,0 +1,45 @@ +name: Test Cache + +on: + workflow_dispatch: + +jobs: + TestCache: + env: + RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache + name: Cache Go + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version: '>=1.20.1' + + - name: Get go-hashfiles + uses: https://gitea.com/actions/go-hashfiles@v0.0.1 + id: hash-go + with: + patterns: |- + go.mod + go.sum + + - name: Echo hash + run: echo ${{ steps.hash-go.outputs.hash }} + + - name: Cache go + id: cache-go + uses: https://github.com/actions/cache@v3 # Action cache + with: # specify with your GOMODCACHE and GOCACHE + path: |- + /root/go/pkg/mod + /root/.cache/go-build + key: go_cache-${{ steps.hash-go.outputs.hash }} + restore-keys: |- + go_cache-${{ steps.hash-go.outputs.hash }} + + - name: Build + run: go build -v . + + - name: Test + run: go test -v ./... \ No newline at end of file