-
Notifications
You must be signed in to change notification settings - Fork 40
99 lines (83 loc) · 2.39 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
name: ci
on:
pull_request:
push:
branches:
- master
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: ci/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
- name: ci/check-style
run: make check-style
- name: ci/check-modules
run: make check-modules
mocks:
runs-on: ubuntu-20.04 # TODO: move check-mocks back to the newest Ubuntu release
steps:
- name: ci/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
- name: ci/check-mocks
run: make verify-mocks
test:
runs-on: ubuntu-22.04
services:
postgres:
image: cimg/postgres:14.8
env:
POSTGRES_USER: cloud_test
POSTGRES_DB: cloud_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: ci/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
- name: ci/test-postgres
run: make unittest goverall
env:
CLOUD_DATABASE: postgres://cloud_test@localhost:5432/cloud_test?sslmode=disable
- name: ci/test-testwick
run: make unittest
working-directory: ./cmd/tools/testwick
build:
runs-on: ubuntu-22.04
needs:
- test
- lint
steps:
- name: ci/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: ci/build-docker
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
uses: ./.github/actions/docker-build