-
Notifications
You must be signed in to change notification settings - Fork 32
172 lines (170 loc) · 4.56 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
name: Tests
on:
push:
branches: '*'
pull_request:
branches: master
# 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: quay.io/team-helium/router:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
# For some reason the toolchain is no installed properly so lets add it...
- name: rustup default stable
run: rustup default stable
- name: checkout
uses: actions/checkout@v2
- name: cleanup
run: |
mkdir -p /tmp/router/_build
cp -R /opt/router/_build/* /tmp/router/_build
cp -R * /tmp/router
rm -rf /opt/router/*
cp -R /tmp/router /opt
rm -rf /tmp/router
- name: build
run: |
make grpc
./rebar3 compile
working-directory: /opt/router
- name: build test
run: ./rebar3 as test compile
working-directory: /opt/router
- name: tar
run: tar -cvzf build.tar.gz -C _build/ .
working-directory: /opt/router
- name: upload-artifact
uses: actions/upload-artifact@v2
with:
name: build
path: /opt/router/build.tar.gz
xref:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/router:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-xref
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: grpc
run: make grpc
- name: xref
run: make xref
eunit:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/router:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-eunit
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: grpc
run: make grpc
- name: eunit
run: make eunit -v
dialyzer:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/router:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-dialyzer
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: grpc
run: make grpc
- name: dialyzer
run: make 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: quay.io/team-helium/router:CI
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
env:
IC_APP_NAME: '${{ secrets.IC_APP_NAME }}'
IC_SCOPE_ID: '${{ secrets.IC_SCOPE_ID }}'
IC_API_KEY: '${{ secrets.IC_API_KEY }}'
steps:
- name: checkout
uses: actions/checkout@v2
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: ct ${{ matrix.suite }}
run: |
make grpc
CT_LAGER=DEBUG ./rebar3 ct --suite=${{ matrix.suite }} --readable=true