-
Notifications
You must be signed in to change notification settings - Fork 15
178 lines (168 loc) · 5.3 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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
conan-cache:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: faasm.azurecr.io/faabric:0.16.0
env:
DEPLOYMENT_TYPE: gha-ci
steps:
- name: "Check-out code"
uses: actions/checkout@v4
- uses: faasm/conan-cache-action@v3
- 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.16.0
steps:
- name: "Check out code"
uses: actions/checkout@v4
- 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.16.0
steps:
- name: "Check out code"
uses: actions/checkout@v4
# 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:
DEPLOYMENT_TYPE: gha-ci
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm.azurecr.io/faabric:0.16.0
options: --privileged
services:
redis:
image: redis
steps:
- name: "Check-out code"
uses: actions/checkout@v4
- uses: faasm/conan-cache-action@v3
- 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@v4
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:
DEPLOYMENT_TYPE: gha-ci
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm.azurecr.io/faabric:0.16.0
options: --privileged
services:
redis:
image: redis
steps:
- name: "Check-out code"
uses: actions/checkout@v4
- uses: faasm/conan-cache-action@v3
- 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
timeout-minutes: 15
dist-tests:
if: github.event.pull_request.draft == false
needs: [conan-cache]
runs-on: ubuntu-latest
env:
CONAN_CACHE_MOUNT_SOURCE: ~/.conan/
steps:
# --- Code update ---
- name: "Check out code"
uses: actions/checkout@v4
- name: "Conan cache"
uses: faasm/conan-cache-action@v3
- name: "Build distributed tests"
run: ./dist-test/build.sh
- name: "Run the distributed tests"
run: ./dist-test/run.sh
timeout-minutes: 7
- name: "Print dist-test server logs"
if: always()
run: docker compose logs dist-test-server
- 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:
DEPLOYMENT_TYPE: gha-ci
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm.azurecr.io/faabric:0.16.0
services:
redis:
image: redis
steps:
- name: "Check-out code"
uses: actions/checkout@v4
- uses: faasm/conan-cache-action@v3
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