40 lines
1011 B
YAML
Raw Normal View History

2025-02-19 20:27:50 +08:00
name: run go test
on:
push:
paths:
- '**/*.go'
- go.mod
- go.lock
- go.work
2025-02-19 20:46:53 +08:00
- .gitea/workflows/go-test.yaml
2025-02-19 20:27:50 +08:00
env:
GOPROXY: ${{ vars.GOPROXY }}
jobs:
test:
2025-02-19 21:30:49 +08:00
runs-on: docker
2025-02-19 20:27:50 +08:00
steps:
- name: Setup apt mirror
run: sed -i "s,deb.debian.org,${{ vars.DEBIAN_MIRROR }},g" ${{ vars.DEBIAN_APT_SOURCES }}
if: ${{ vars.DEBIAN_MIRROR && vars.DEBIAN_APT_SOURCES }}
- name: Setup Debian environment
run: apt update && apt install -y nodejs
2025-02-19 20:46:53 +08:00
- name: Setup cache for golang toolchain
uses: actions/cache@v4
with:
path: |
/opt/hostedtoolcache/go
/root/go/pkg/mod
/root/.cache/go-build
key: ${{ runner.os }}-golang
2025-02-19 20:27:50 +08:00
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: 1.24.0
2025-02-19 20:46:53 +08:00
cache-dependency-path: |
go.sum
2025-02-19 20:27:50 +08:00
- name: Check out repository code
uses: actions/checkout@v4
- name: Run tests
run: go test -v ./...