Add .gitea/workflows/*.yaml
All checks were successful
Caching with Go / Cache Go (push) Successful in 2m22s

This commit is contained in:
2025-10-20 22:55:39 -07:00
parent b22f63dc80
commit b0e7243a58

View File

@@ -1,45 +1,26 @@
name: Test Cache name: Caching with Go
on: push
on:
workflow_dispatch:
jobs: jobs:
TestCache: Cache-Go:
env:
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
name: Cache Go name: Cache Go
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-go@v3 - uses: actions/setup-go@v3
with: with:
go-version: '>=1.20.1' go-version: '>=1.20.1'
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
- name: Get go-hashfiles
uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go id: hash-go
with: with:
patterns: |- patterns: |
go.mod go.mod
go.sum go.sum
- name: cache go
- name: Echo hash
run: echo ${{ steps.hash-go.outputs.hash }}
- name: Cache go
id: cache-go id: cache-go
uses: https://github.com/actions/cache@v3 # Action cache uses: actions/cache@v3
with: # specify with your GOMODCACHE and GOCACHE with: # Specify with your cache path
path: |- path: |
/root/go/pkg/mod /your_cache_path
/root/.cache/go-build key: go_path-${{ steps.hash-go.outputs.hash }}
key: go_cache-${{ steps.hash-go.outputs.hash }}
restore-keys: |- restore-keys: |-
go_cache-${{ steps.hash-go.outputs.hash }} go_cache-${{ steps.hash-go.outputs.hash }}
- name: Build
run: go build -v .
- name: Test
run: go test -v ./...