-
Notifications
You must be signed in to change notification settings - Fork 7
149 lines (147 loc) · 4.11 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
name: Tests
on:
push:
branches: master
pull_request:
branches: master
# Run every day at midnight PST (0800 UTC)
# https://crontab.guru/#0_8_*_*_*
schedule:
- cron: '0 8 * * *'
jobs:
build:
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser: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/packet_purchaser/_build
cp -R /opt/packet_purchaser/_build/* /tmp/packet_purchaser/_build
cp -R * /tmp/packet_purchaser
rm -rf /opt/packet_purchaser/*
cp -R /tmp/packet_purchaser /opt
rm -rf /tmp/packet_purchaser
- name: build
run: |
make grpc
./rebar3 compile
working-directory: /opt/packet_purchaser
- name: build test
run: ./rebar3 as test compile
working-directory: /opt/packet_purchaser
- name: tar
run: tar -cvzf build.tar.gz -C _build/ .
working-directory: /opt/packet_purchaser
- name: upload-artifact
uses: actions/upload-artifact@v2
with:
name: build
path: /opt/packet_purchaser/build.tar.gz
xref:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser: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: xref
run: make xref
eunit:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser: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: eunit
run: make eunit -v
dialyzer:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser: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: set-lockfile-hash
id: set_vars
run: |
rebar_hash="${{hashFiles(format('{0}{1}', github.workspace, '/rebar.lock'))}}"
echo "::set-output name=rebar_hash::$rebar_hash"
- name: cache PLT files
id: cache-plt
uses: actions/cache@v2
with:
path: |
_build/default/*_plt
_build/default/*_plt.hash
key: plt-cache-${{ steps.set_vars.outputs.rebar_hash }}
restore-keys: |
plt-cache-
- name: dialyzer
run: make dialyzer
ct:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-ct
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: ct
run: CT_LAGER=DEBUG make ct