-
Notifications
You must be signed in to change notification settings - Fork 15
190 lines (180 loc) · 5.94 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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
defaults:
run:
shell: bash
jobs:
# Cancel previous running actions for the same PR
cancel_previous:
runs-on: ubuntu-latest
steps:
- name: Cancel Workflow Action
uses: styfle/[email protected]
conan-cache:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm.azurecr.io/faabric:0.4.6
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
steps:
- uses: faasm/conan-cache-action@v1
- name: "Build Conan CMake deps to be shared by all runs"
run: ./bin/inv_wrapper.sh dev.cmake --build Debug --clean
docs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm.azurecr.io/faabric:0.4.6
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
steps:
- name: "Check out code"
uses: actions/checkout@v3
- name: "Build docs"
run: ./bin/inv_wrapper.sh docs
formatting:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm.azurecr.io/faabric:0.4.6
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
steps:
- name: "Check out code"
uses: actions/checkout@v3
# We need to set the safe git directory as formatting relies on git-ls
# See actions/checkout#766
- name: "Set the GH workspace as a safe git directory"
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: "Code formatting checks"
run: ./bin/inv_wrapper.sh format-code --check
code-coverage:
if: github.event.pull_request.draft == false
needs: [conan-cache]
runs-on: ubuntu-latest
env:
HOST_TYPE: ci
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm.azurecr.io/faabric:0.4.6
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
options: --privileged
services:
redis:
image: redis
steps:
- uses: faasm/conan-cache-action@v1
- name: "Ping redis"
run: redis-cli -h redis ping
- name: "Run cmake for tests"
run: ./bin/inv_wrapper.sh dev.cmake --clean --build=Debug --coverage
- name: "Build tests"
run: ./bin/inv_wrapper.sh dev.cc faabric_tests
- name: "Run tests with profiling"
run: ./bin/inv_wrapper.sh tests
env:
LLVM_PROFILE_FILE: faabric.profraw
- name: "Generate code coverage report"
run: ./bin/inv_wrapper.sh dev.coverage-report --file-in faabric.profraw --file-out coverage.txt
- name: "Upload coverage report to CodeCov"
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
tests:
if: github.event.pull_request.draft == false
needs: [conan-cache]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitiser: [None, Address, Thread, Undefined]
env:
HOST_TYPE: ci
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm.azurecr.io/faabric:0.4.6
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
options: --privileged
services:
redis:
image: redis
steps:
- uses: faasm/conan-cache-action@v1
- name: "Ping redis"
run: redis-cli -h redis ping
- name: "Run cmake for tests"
run: ./bin/inv_wrapper.sh dev.cmake --clean --build=Debug --sanitiser ${{ matrix.sanitiser }}
- name: "Build tests"
run: ./bin/inv_wrapper.sh dev.cc faabric_tests
- name: "Run tests"
run: ./bin/inv_wrapper.sh tests
dist-tests:
if: github.event.pull_request.draft == false
needs: [conan-cache]
runs-on: ubuntu-latest
env:
CONAN_CACHE_MOUNT_SOURCE: ~/.conan/
steps:
- name: "Log in to ACR"
uses: docker/login-action@v2
with:
registry: faasm.azurecr.io
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
# --- Code update ---
- name: "Check out code"
uses: actions/checkout@v3
- name: "Conan cache"
uses: faasm/conan-cache-action@v1
- name: "Build distributed tests"
run: ./dist-test/build.sh
- name: "Run the distributed tests"
run: ./dist-test/run.sh
- name: "Print planner logs"
if: always()
run: docker compose logs planner
examples:
if: github.event.pull_request.draft == false
needs: [conan-cache]
runs-on: ubuntu-latest
env:
HOST_TYPE: ci
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm.azurecr.io/faabric:0.4.6
credentials:
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
services:
redis:
image: redis
steps:
- uses: faasm/conan-cache-action@v1
with:
build-type: "release"
- name: "Run cmake shared"
run: ./bin/inv_wrapper.sh dev.cmake --clean --shared --build=Release
- name: "Build Faabric shared library"
run: ./bin/inv_wrapper.sh dev.cc faabric --shared
- name: "Install Faabric shared library"
run: ./bin/inv_wrapper.sh dev.install faabric --shared
- name: "Build examples"
run: ./bin/inv_wrapper.sh examples
- name: "Run example to check"
run: ./bin/inv_wrapper.sh examples.execute check