release-action/.gitea/workflows/test.yml

46 lines
1.2 KiB
YAML
Raw Normal View History

2023-05-14 15:17:39 +00:00
name: checks
2023-08-06 05:41:01 +00:00
on:
2023-05-14 15:17:39 +00:00
- push
- pull_request
env:
GOPROXY: https://goproxy.io,direct
2023-08-06 05:39:35 +00:00
GOPATH: /home/rootless/go_path
GOCACHE: /home/rootless/go_cache
2023-05-14 15:17:39 +00:00
jobs:
lint:
name: check and test
runs-on: ubuntu-latest
steps:
- name: cache go path
id: cache-go-path
uses: https://github.com/actions/cache@v3
with:
2023-08-06 05:39:35 +00:00
path: /home/rootless/go_path
2023-05-14 15:17:39 +00:00
key: go_path-${{ github.repository }}-${{ github.ref_name }}
restore-keys: |
go_path-${{ github.repository }}-
2023-08-06 05:32:17 +00:00
go_path-
2023-05-14 15:17:39 +00:00
- name: cache go cache
id: cache-go-cache
uses: https://github.com/actions/cache@v3
with:
2023-08-06 05:39:35 +00:00
path: /home/rootless/go_cache
2023-05-14 15:17:39 +00:00
key: go_cache-${{ github.repository }}-${{ github.ref_name }}
restore-keys: |
go_cache-${{ github.repository }}-
2023-08-06 05:32:17 +00:00
go_cache-
2023-05-14 15:17:39 +00:00
- uses: actions/setup-go@v3
with:
go-version: 1.20
- uses: actions/checkout@v3
- name: lint
run: go install golang.org/x/lint/golint@latest && golint ./...
- name: vet
run: go vet
2023-08-06 05:43:19 +00:00
# env:
# CGO_ENABLED: 1
2023-05-14 15:17:39 +00:00
- name: test
2023-08-06 05:41:01 +00:00
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...