forked from berty/berty
-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (158 loc) · 5.71 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: Integration
on:
# @moul: temporarily disabled.
# the test is flappy and the current notification system make it not very useful.
# I think that we should move the prod integration test to an external monitoring and only keep the CI/CD related integration test here.
#schedule:
# - cron: '0 * * * *'
push:
tags:
- v*
branches:
- master
paths:
- 'go/**'
- '!go/**.md'
- 'go.*'
- '**.go'
- 'js/**'
- '!js/packages/i18n/locale/*/*.json'
- '.github/workflows/integration.yml'
pull_request:
paths:
- 'go/**'
- '!go/**.md'
- 'go.*'
- '**.go'
- 'js/**'
- '!js/packages/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
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/checkout@v3
- name: Load variables from file
uses: antifree/[email protected]
with:
filename: .github/workflows/utils/variables.json
- name: Setup asdf
uses: asdf-vm/actions/setup@v1
- name: Setup go
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Cache Go modules
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- 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
asdf reshim golang # See: https://github.com/kennyp/asdf-golang/issues/18
- name: Run integration test suite
run: |
berty-integration \
-p2p.disc-disable-filter=true \
-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
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Docker images
working-directory: tool/integration-compose
run: docker compose build
- name: Run integration test suite
working-directory: tool/integration-compose
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
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/checkout@v3
- name: Load variables from file
uses: antifree/[email protected]
with:
filename: .github/workflows/utils/variables.json
- name: Setup asdf
uses: asdf-vm/actions/setup@v1
- name: Setup go
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Cache Go modules
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- 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
asdf reshim golang # See: https://github.com/kennyp/asdf-golang/issues/18
- 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 }}'