forked from berty/berty
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (154 loc) · 4.86 KB
/
integration.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Integration
on:
schedule:
- cron: '0 * * * *'
push:
tags:
- v*
branches:
- master
paths:
- 'go/**'
- '!go/**.md'
- 'go.*'
- '**.go'
- 'js/**'
- '!js/packages/berty-i18n/locale/*/*.json'
- '.github/workflows/integration.yml'
pull_request:
paths:
- 'go/**'
- '!go/**.md'
- 'go.*'
- '**.go'
- 'js/**'
- '!js/packages/berty-i18n/locale/*/*.json'
- '.github/workflows/integration.yml'
# FIXME:
# * test on production periodically with env=production
# * test against a fresh docker-compose infra on each commit
# * store performance logs for comparison
jobs:
integration-prod:
if: github.event_name == 'schedule'
name: "integration (production)"
runs-on: ubuntu-latest
strategy:
matrix:
golang: [1.16.x]
env:
OS: ubuntu-latest
GOLANG: ${{ matrix.golang }}
steps:
- name: "Generate run's URL"
id: url
run: |
echo "::set-output name=runUrl::https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
- name: Checkout
uses: actions/[email protected]
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}
- name: Cache Go modules
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-v1-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ matrix.golang }}-v1-
- name: Avoid triggering make generate
run: touch go/gen.sum
- name: Fetch dependencies
run: go mod download
- name: Compile the integration binary
working-directory: go
run: go install ./cmd/berty-integration
- name: Run integration test suite
run: |
berty-integration \
-integration.testbot=`cat ./config/config.gen.json | jq -r '.berty.contacts["testbot"].link'` \
-integration.benchmark > benchmark_result.json
- name: Download previous benchmark data
uses: actions/[email protected]
with:
path: ./cache
key: ${{runner.os}}-integration-benchmark
- name: Discord notification
if: failure()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_PROD_WEBHOOK }}
uses: Ilshidur/[email protected]
with:
args: 'Integration failed, see ${{ steps.url.outputs.runUrl }}'
integration-local:
if: github.event_name == 'push' || github.event_name == 'pull_request'
name: "integration (local)"
runs-on: ubuntu-latest
strategy:
matrix:
golang: [1.16.x]
env:
OS: ubuntu-latest
GOLANG: ${{ matrix.golang }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Build Docker images
working-directory: tool/compose-integration
run: docker-compose build
- name: Run integration test suite
working-directory: tool/compose-integration
run: make
#- name: Store benchmark result
# uses: rhysd/github-action-benchmark@v1
# with:
# tool: 'googlecpp'
# output-file-path: benchmark_result.json
# external-data-json-path: ./cache/benchmark-data.json
# fail-on-alert: false
# comment-on-alert: true
# github-token: ${{secrets.GITHUB_TOKEN}}
# #alert-comment-cc-users: '@foobar'
# #auto-push: true
doctor-production:
name: "doctor (production)"
runs-on: ubuntu-latest
strategy:
matrix:
golang: [1.16.x]
env:
OS: ubuntu-latest
GOLANG: ${{ matrix.golang }}
steps:
- name: Generate run's URL
id: url
run: |
echo "::set-output name=runUrl::https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
- name: Checkout
uses: actions/[email protected]
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}
- name: Cache Go modules
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang}}-v1-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ matrix.golang}}-v1-
- name: Avoid triggering make generate
run: touch go/gen.sum
- name: Fetch dependencies
run: go mod download
- name: Compile the doctor binary
working-directory: go
run: go install ./cmd/berty-doctor
- name: Run doctor
run: berty-doctor -v
- name: Discord notification
if: github.event_name == 'schedule' && failure()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_PROD_WEBHOOK }}
uses: Ilshidur/[email protected]
with:
args: 'Doctor failed, see ${{ steps.url.outputs.runUrl }}'