-
Notifications
You must be signed in to change notification settings - Fork 11
125 lines (121 loc) · 4.11 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
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
name: ci
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Build
run: make build
lint:
runs-on: ubuntu-latest
env:
golangci-lint-version: 'v1.42.1'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Cache golangci-lint
uses: actions/cache@v2
env:
cache-name: cache-golangci-lint
with:
path: ~/bin/golangci-lint
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.golangci-lint-version }}
- name: Install golangci-lint
run: |
echo ~/bin >> $GITHUB_PATH
~/bin/golangci-lint --version && exit 0
mkdir -p ~/bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b ~/bin ${{ env.golangci-lint-version }}
- uses: actions/setup-python@v2
- name: Run pre-commit
run: |
pip install pre-commit &&
pre-commit run --all --show-diff-on-failure
unit-test:
runs-on: ubuntu-latest
env:
oomplay-version: '0.6.8'
steps:
- uses: actions/checkout@v2
- uses: satackey/[email protected]
continue-on-error: true
with:
key: docker-cache-{hash}
restore-keys: docker-cache-
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Install oomplay
run: |
v=${{env.oomplay-version}}
pkg=oomplay-musl_${v}_amd64.deb
wget https://github.com/oom-ai/oomplay/releases/download/v${v}/${pkg} &&
sudo dpkg -i ${pkg}
- name: Install gotestsum
run: |
echo ~/bin >> $GITHUB_PATH
mkdir -p ~/bin && cd ~/bin
wget https://github.com/gotestyourself/gotestsum/releases/download/v1.7.0/gotestsum_1.7.0_linux_amd64.tar.gz
tar xvf gotestsum_1.7.0_linux_amd64.tar.gz && chmod +x gotestsum
- name: Run unit tests
run: make test
env:
SNOWFLAKE_TEST_ACCOUNT: ${{ secrets.SNOWFLAKE_TEST_ACCOUNT }}
SNOWFLAKE_TEST_USER: ${{ secrets.SNOWFLAKE_TEST_USER }}
SNOWFLAKE_TEST_PASSWORD: ${{ secrets.SNOWFLAKE_TEST_PASSWORD }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
REDSHIFT_TEST_HOST: ${{ secrets.REDSHIFT_TEST_HOST }}
REDSHIFT_TEST_USER: ${{ secrets.REDSHIFT_TEST_USER }}
REDSHIFT_TEST_PASSWORD: ${{ secrets.REDSHIFT_TEST_PASSWORD }}
- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
fail_ci_if_error: false
verbose: true
integration-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backends:
- { online: sqlite, offline: sqlite, metadata: sqlite }
- { online: mysql, offline: mysql, metadata: mysql }
- { online: postgres, offline: postgres, metadata: postgres }
- { online: redis, offline: sqlite, metadata: sqlite }
- { online: redis, offline: mysql, metadata: mysql }
- { online: redis, offline: postgres, metadata: postgres }
env:
oomplay-version: '0.6.8'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Install grpcurl
run: |
echo ~/bin >> $GITHUB_PATH
mkdir -p ~/bin && cd ~/bin
wget https://github.com/fullstorydev/grpcurl/releases/download/v1.8.5/grpcurl_1.8.5_linux_x86_64.tar.gz &&
tar xvf grpcurl_1.8.5_linux_x86_64.tar.gz && chmod +x grpcurl
- name: Install oomplay
run: |
v=${{env.oomplay-version}}
pkg=oomplay-musl_${v}_amd64.deb
wget https://github.com/oom-ai/oomplay/releases/download/v${v}/${pkg} &&
sudo dpkg -i ${pkg}
- name: Run integration tests
run: |
export BACKENDS='${{ matrix.backends.online }},${{ matrix.backends.offline }},${{ matrix.backends.metadata }}'
make integration-test