-
Notifications
You must be signed in to change notification settings - Fork 7
236 lines (234 loc) · 7.22 KB
/
tests.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
name: Tests
on:
push:
branches: '*'
pull_request:
branches: main
# Run every day at midnight PST (0800 UTC)
# https://crontab.guru/#0_8_*_*_*
schedule:
- cron: '0 8 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: build
run: make
env:
CARGO_BUILD_RUSTFLAGS: -C target-feature=-crt-static
- name: build test
run: ./rebar3 as test compile
env:
CARGO_BUILD_RUSTFLAGS: -C target-feature=-crt-static
- name: tar
run: tar -cvzf build.tar.gz -C _build/ .
- name: upload-artifact
uses: actions/upload-artifact@v2
with:
name: build
path: build.tar.gz
xref:
needs: build
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-xref
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: xref
run: ./rebar3 xref
eunit:
needs: build
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-eunit
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: eunit
run: ./rebar3 eunit -v
dialyzer:
needs: build
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-dialyzer
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: dialyzer
run: ./rebar3 dialyzer
suites:
runs-on: ubuntu-latest
outputs:
test_suites: ${{ steps.gen_test_suites.outputs.test_suites }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: gen_test_suites
id: gen_test_suites
run: |
SUITES="["
for F in ./test/*_SUITE.erl
do
SUITES+="\"$(basename $F)\",";
done
# remove last comma
SUITES=${SUITES%,};
# close array
SUITES+="]"
echo "We are in $(pwd)"
echo "::set-output name=test_suites::${SUITES}"
ct:
needs: [build, suites]
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
strategy:
fail-fast: false
matrix:
suite: "${{ fromJSON(needs.suites.outputs.test_suites) }}"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-ct-${{ matrix.suite }}
cancel-in-progress: true
services:
localstack:
image: localstack/localstack:1.4
env:
SERVICES: s3
ports:
- '4566-4583:4566-4583'
volumes:
- "/var/lib/localstack:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
env:
HPR_PACKET_REPORTER_LOCAL_HOST: ${{ secrets.HPR_PACKET_REPORTER_LOCAL_HOST }}
HPR_PACKET_REPORTER_LOCAL_PORT: ${{ secrets.HPR_PACKET_REPORTER_LOCAL_PORT }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim python3 python3-dev py3-pip
- name: localstack
run: |
curl 'http://localstack:4566/health'
pip install awscli-local[ver1]
aws configure set aws_access_key_id testkey
aws configure set aws_secret_access_key testsecret
aws configure set default.region us-east-1
aws s3 mb s3://test-bucket --endpoint-url=http://localstack:4566
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: ct
run: CT_LAGER=DEBUG ./rebar3 ct --suite=${{ matrix.suite }} --readable=true
release:
needs: build
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-release
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: release
run: make rel