From b0e7243a58ddb03d2477873128d860dfd28830e5 Mon Sep 17 00:00:00 2001 From: hangpersonal Date: Mon, 20 Oct 2025 22:55:39 -0700 Subject: [PATCH] Add .gitea/workflows/*.yaml --- .gitea/workflows/test-cache.yml | 45 ++++++++++----------------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/.gitea/workflows/test-cache.yml b/.gitea/workflows/test-cache.yml index 8a91dff..0231215 100644 --- a/.gitea/workflows/test-cache.yml +++ b/.gitea/workflows/test-cache.yml @@ -1,45 +1,26 @@ -name: Test Cache - -on: - workflow_dispatch: - +name: Caching with Go +on: push jobs: - TestCache: - env: - RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache + Cache-Go: 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 + - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 id: hash-go with: - patterns: |- + patterns: | go.mod - go.sum - - - name: Echo hash - run: echo ${{ steps.hash-go.outputs.hash }} - - - name: Cache go + go.sum + - 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 }} + uses: actions/cache@v3 + with: # Specify with your cache path + path: | + /your_cache_path + key: go_path-${{ 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 + go_cache-${{ steps.hash-go.outputs.hash }} \ No newline at end of file