-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (52 loc) · 1.47 KB
/
build-and-test.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
name: Build and test
on:
pull_request:
push:
branches:
- master
jobs:
build_and_test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres_test # "_test" is required for fixtures
ports:
- 5432/tcp
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
pebble:
image: letsencrypt/pebble:latest
env:
PEBBLE_VA_NOSLEEP: 1
PEBBLE_VA_ALWAYS_VALID: 1
PEBBLE_AUTHZREUSE: 0
PEBBLE_WFE_NONCEREJECT: 0
ports:
- 14000/tcp
steps:
- name: Install Golang
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
- name: Build
run: make build
- name: Test
run: make test
env:
SONAR_DB_DSN: 'postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres_test?sslmode=disable'
SONAR_DB_MIGRATIONS: internal/database/migrations
CERTMGR_CA_DIR_URL: 'https://localhost:${{ job.services.pebble.ports[14000] }}/dir'
- name: Code coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out