-
Notifications
You must be signed in to change notification settings - Fork 25
57 lines (44 loc) · 1.18 KB
/
go.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
name: Build and test
on:
push:
branches: [main]
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
build:
runs-on: ubuntu-latest
services:
sqld:
image: ghcr.io/libsql/sqld:latest
ports:
- 8080:8080
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
cache: true
- name: Format
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
- name: Install dependencies
run: go get ./...
- name: Vet
run: go vet -v ./...
- name: Install sqlclosecheck
run: go install github.com/ryanrolds/sqlclosecheck@latest
- name: sqlclosecheck
run: go vet -vettool=${HOME}/go/bin/sqlclosecheck ./...
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -parallel 1 ./...
env:
LIBSQL_TEST_HTTP_DB_URL: "http://127.0.0.1:8080"
LIBSQL_TEST_WS_DB_URL: "ws://127.0.0.1:8080"