forked from Shyp/rickover
-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (47 loc) · 1.61 KB
/
ci.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: tests
on: [push, pull_request]
jobs:
test:
name: Build, lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
path: './src/github.com/kevinburke/rickover'
- uses: actions/setup-go@v3
with:
go-version: 1.21.x
# staticcheck needs this for GOPATH
- run: echo "GOPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- run: echo "PATH=$GITHUB_WORKSPACE/bin:$PATH" >> $GITHUB_ENV
- uses: actions/cache@master
with:
path: /go/bin
key: ${{ runner.os }}-gobin-v1-${{ hashFiles('**/Gopkg.lock') }}
restore-keys: |
${{ runner.os }}-gobin-v1-
- uses: actions/cache@master
with:
path: /github/home/.cache
key: ${{ runner.os }}-go-v1-${{ hashFiles('**/Gopkg.lock') }}
restore-keys: |
${{ runner.os }}-go-v1-
- name: install envdir
run: go install github.com/kevinburke/envdir@latest
- name: Start Postgres, install Goose, migrate database
working-directory: ./src/github.com/kevinburke/rickover
run: |
make goose
envdir envs/github make migrate-ci
- name: Lint
working-directory: ./src/github.com/kevinburke/rickover
run: |
make staticcheck
envdir envs/github make lint
- name: Test rickover
# github env has correct database URL
run: envdir envs/github go test -p=1 -race -timeout 10s ./...
working-directory: ./src/github.com/kevinburke/rickover
- name: Run benchmarks
run: envdir envs/github make benchmark-ci
working-directory: ./src/github.com/kevinburke/rickover