43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: CI
|
|
run-name: ${{ gitea.actor }} running CI
|
|
on: [push]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.24.4' # The Go version to download (if necessary) and use.
|
|
- 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 }}
|
|
- run: go version
|
|
|
|
# unit and integration tests, coverage
|
|
- run: go test ./... -coverprofile cover.out
|
|
- run: go tool cover -html=cover.out -o cover.html
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: coverage.html
|
|
path: ./cover.html
|