-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 1.81 KB
/
testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Testing
on:
push:
branches:
- "*"
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/testing.yml"
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened ]
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/testing.yml"
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Testing
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
go: [ "1.20" ]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: ${{ matrix.go }}
- name: Set up Tor
uses: tor-actions/setup-tor@main
with:
daemon: true
- name: Check out code base
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
fetch-depth: 0
- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Run Testing
run: |
go clean -testcache
go test -v -race -cover -coverprofile=coverage.out -covermode=atomic ./...
go tool cover -func=coverage.out
shell: bash
- name: Run Integration Testing
run: |
go clean -testcache
go test -v -race -tags integration -cover -coverprofile=integration.out -covermode=atomic ./...
go tool cover -func=integration.out
shell: bash