-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.36 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
name: integration
on: push
jobs:
container-job:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: webhooks
POSTGRES_DB: webhooks
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Check out repository code
uses: actions/checkout@v3
- name: Build
run: go build -v -race .
- name: Setup tests
env:
POSTGRES_URL: postgres://postgres:webhooks@localhost:5432/webhooks?sslmode=disable
run: |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.15.2/migrate.linux-amd64.tar.gz | tar xvz
./migrate -path migrations -database ${POSTGRES_URL} --verbose up
- name: Test
env:
SERVERLESS_SENDER_URL: https://serverless.demo
TWITTER_TOKEN: undefined
POSTGRES_URL: postgres://postgres:webhooks@localhost:5432/webhooks?sslmode=disable
run: |
go test -v -race -coverprofile=coverage.txt -covermode=atomic .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2