-
Notifications
You must be signed in to change notification settings - Fork 7
97 lines (78 loc) · 2.08 KB
/
test.yml
File metadata and controls
97 lines (78 loc) · 2.08 KB
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
name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.26']
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build -v ./...
- name: Build WASM
run: GOOS=js GOARCH=wasm go build -o /dev/null ./wasm/
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: ['1.26']
env:
# Prevent Go from auto-downloading toolchain which conflicts with setup-go cache
GOTOOLCHAIN: local
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
- name: Get dependencies
run: go mod download
- name: Run tests
run: go test -v -race -coverprofile coverage.txt -covermode atomic ./pkg/...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.txt
flags: unittests
name: codecov-${{ matrix.os }}-${{ matrix.go }}
continue-on-error: true
race-check:
name: Race Detector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26'
cache: true
- name: Run tests with race detector
run: go test -race -short ./...
benchmark:
name: Benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26'
cache: true
- name: Run benchmarks
run: |
go test -run=^$ -bench=. -benchmem -timeout=5m ./pkg/sql/tokenizer/
go test -run=^$ -bench=. -benchmem -timeout=5m ./pkg/sql/parser/
go test -run=^$ -bench=. -benchmem -timeout=5m ./pkg/sql/ast/