Add .gitea/workflows/*.yaml

This commit is contained in:
2025-10-20 22:20:59 -07:00
parent 71a378cbe6
commit b22f63dc80
2 changed files with 45 additions and 29 deletions

View File

@@ -1,29 +0,0 @@
name: Caching with Go
on:
workflow_dispatch:
jobs:
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'
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go
with:
patterns: |
go.mod
go.sum
- name: cache go
id: cache-go
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 }}

View File

@@ -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 ./...