-
Notifications
You must be signed in to change notification settings - Fork 8
200 lines (190 loc) · 5.68 KB
/
tests.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: go get .
- name: Build Linux
run: GOOS=linux GOARCH=amd64 go build ./...
- name: Build Linux (tiny)
run: GOOS=linux GOARCH=amd64 go build -tags tiny ./...
- name: Build Windows
run: GOOS=windows GOARCH=amd64 go build ./...
- name: Build Windows (tiny)
run: GOOS=windows GOARCH=amd64 go build -tags tiny ./...
- name: Build MacOS
run: GOOS=darwin GOARCH=amd64 go build ./...
- name: Build MacOS (tiny)
run: GOOS=darwin GOARCH=amd64 go build -tags tiny ./...
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22.x'
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
run: |
go get .
- name: Run Unit tests
run: |
go test -v -covermode atomic -coverprofile="coverage.out" ./...
go tool cover -func="coverage.out"
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
path-to-lcov: coverage.out
test_tiny:
name: Run tests (tiny)
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22.x'
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
run: |
go get .
- name: Run Unit tests (tiny)
run: |
go test -tags tiny -v -covermode atomic -coverprofile="coverage.out" ./...
go tool cover -func="coverage.out"
test_debug:
name: Run tests (debug)
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22.x'
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
run: |
go get .
- name: Run Unit tests (debug)
run: |
go test -tags debug -v -covermode atomic -coverprofile="coverage.out" ./...
go tool cover -func="coverage.out"
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get .
go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/gordonklaus/ineffassign@latest
- name: Check format
run: |
if gofmt -e -l . >&1 | grep '^'; then
exit 1
fi
- name: Lint with vet
run: go vet ./...
- name: Lint with vet (tiny)
run: go vet -tags tiny ./...
- name: Lint with staticcheck
run: staticcheck ./...
- name: Lint with staticcheck (tiny)
run: staticcheck -tags tiny ./...
- name: Lint with ineffassign
run: ineffassign ./...
semver:
name: Run SemVer check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get .
go install golang.org/x/exp/cmd/gorelease@latest
- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: latest-tag
- name: Run gorelease
run: gorelease -base=${{ steps.latest-tag.outputs.tag }}
examples:
name: Run Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: go get .
- name: Run examples
run: |
go run ./_examples/base
go run ./_examples/batch_ops
go run ./_examples/events
go run ./_examples/filter
go run ./_examples/generic
go run ./_examples/locked_world
go run ./_examples/no_ecs
go run ./_examples/no_ecs_generic
go run ./_examples/parallel
go run ./_examples/random_access
go run ./_examples/random_sampling
go run ./_examples/readme
go run ./_examples/relations
go run ./_examples/resources
go run ./_examples/systems
go run ./_examples/world_stats
examples_tiny:
name: Run Examples (tiny)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: go get .
- name: Run examples
run: |
go run -tags tiny ./_examples/base
go run -tags tiny ./_examples/batch_ops
go run -tags tiny ./_examples/events
go run -tags tiny ./_examples/filter
go run -tags tiny ./_examples/generic
go run -tags tiny ./_examples/locked_world
go run -tags tiny ./_examples/no_ecs
go run -tags tiny ./_examples/no_ecs_generic
go run -tags tiny ./_examples/parallel
go run -tags tiny ./_examples/random_access
go run -tags tiny ./_examples/random_sampling
go run -tags tiny ./_examples/readme
go run -tags tiny ./_examples/relations
go run -tags tiny ./_examples/resources
go run -tags tiny ./_examples/systems
go run -tags tiny ./_examples/world_stats