Add .gitea/workflows/*.yaml
This commit is contained in:
@@ -1,42 +1,19 @@
|
|||||||
name: Test Cache
|
name: Cache smoke test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
TestCache:
|
test-cache:
|
||||||
name: Cache Go
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-go@v3
|
- name: Use cache
|
||||||
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
go-version: '>=1.20.1'
|
path: ~/.cache/mytool
|
||||||
|
key: demo-cache-${{ runner.os }}-v1
|
||||||
- name: Get go-hashfiles
|
- name: Touch a file to cache
|
||||||
uses: https://gitea.com/actions/go-hashfiles@v0.0.1
|
run: |
|
||||||
id: hash-go
|
mkdir -p ~/.cache/mytool
|
||||||
with:
|
date > ~/.cache/mytool/when.txt
|
||||||
patterns: |
|
|
||||||
go.mod
|
|
||||||
go.sum
|
|
||||||
|
|
||||||
- name: Echo hash
|
|
||||||
run: echo ${{ steps.hash-go.outputs.hash }}
|
|
||||||
|
|
||||||
- name: Cache go
|
|
||||||
id: cache-go
|
|
||||||
uses: actions/cache@v3
|
|
||||||
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 ./...
|
|
||||||
|
|||||||
Reference in New Issue
Block a user