-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (43 loc) · 1.4 KB
/
ci.yml
File metadata and controls
52 lines (43 loc) · 1.4 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
name: Ci Integration Test
on: push
jobs:
container-job:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.1
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: pwd
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v2
#official elastic github action: https://github.com/elastic/elastic-github-actions/tree/master/elasticsearch
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.6.0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: go build -v ./...
- name: Run coverage
run: go test -v ./... -race -coverprofile=tmp.txt -coverpkg ./... && cat tmp.txt | grep -v starter.go | grep -v test | grep -v filereader > coverage.txt
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)