forked from magma/magma
-
Notifications
You must be signed in to change notification settings - Fork 0
502 lines (490 loc) · 22.8 KB
/
agw-workflow.yml
File metadata and controls
502 lines (490 loc) · 22.8 KB
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
---
name: agw-workflow
on:
push:
branches:
- master
- 'v1.*'
pull_request:
branches:
- master
- 'v1.*'
types: [ opened, reopened, synchronize ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
DEVCONTAINER_IMAGE: "ghcr.io/magma/magma/devcontainer:latest"
BAZEL_BASE_IMAGE: "ghcr.io/magma/magma/bazel-base:latest"
CACHE_KEY: bazel-base-image
jobs:
path_filter:
runs-on: ubuntu-latest
outputs:
should_not_skip: ${{ steps.changes.outputs.filesChanged }}
steps:
# Need to get git on push event
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
if: github.event_name == 'push'
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721 # pin@v2
id: changes
with:
filters: |
filesChanged:
- '.github/workflows/agw-workflow.yml'
- 'orc8r/**'
- 'lte/**'
- '.bazelrc'
- 'WORKSPACE.bazel'
- 'bazel/**'
- name: Save should_not_skip output
if: always()
run: |
mkdir -p ./pr
echo -n ${{ steps.changes.outputs.filesChanged == 'false' }} > ./pr/skipped
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # pin@v3
if: always()
with:
name: pr
path: pr/
lte-test:
needs: path_filter
if: ${{ needs.path_filter.outputs.should_not_skip == 'true' }}
name: lte test job
runs-on: ubuntu-latest
env:
MAGMA_ROOT: "${{ github.workspace }}"
CODEGEN_ROOT: "${{ github.workspace }}/.codegen"
PYTHON_BUILD: "${{ github.workspace }}/build"
PYTHONPATH: "${{ github.workspace }}"
PIP_CACHE_HOME: "${{ github.workspace }}/.pipcache"
SWAGGER_CODEGEN_JAR: "${{ github.workspace }}/.codegen/swagger-codegen-cli.jar"
MAGMA_DEV_MODE: 1
SKIP_SUDO_TESTS: 1
steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- uses: actions/setup-python@7f80679172b057fc5e90d70d197929d454754a5a # pin@v2
with:
python-version: '3.8.10'
- name: Run apt-focal-install-aioeventlet
run: |
cd nms
# Install python3-aioeventlet from the magma apt repo
cat ${{ env.MAGMA_ROOT }}/orc8r/tools/ansible/roles/pkgrepo/files/jfrog.pub | sudo -E apt-key add -
echo "deb https://artifactory.magmacore.org/artifactory/debian-test focal-ci main" | sudo -E tee /etc/apt/sources.list.d/fbc.list
sudo apt-get update -y
sudo apt-get install -y python3-aioeventlet
sudo rm -rf /var/lib/apt/lists/*
- name: Install libraries and dependecies
run: |
mkdir -p /var/tmp/test_results
mkdir -p /var/tmp/codecovs
sudo -E apt-get update -y
sudo -E apt-get install -y libsystemd-dev pkg-config curl zip unzip net-tools
sudo -E apt-get install -y virtualenv python-babel python-dev build-essential autogen autoconf libtool python3-apt python3-requests python3-pip python-protobuf
- name: Setup protoc3
run: |
pip3 install protobuf
pip3 install setuptools==49.6.0
curl -Lfs https://github.com/protocolbuffers/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip -o protoc3.zip
unzip protoc3.zip -d protoc3
sudo -E mv protoc3/bin/protoc /bin/protoc
sudo -E chmod a+rx /bin/protoc
# Workaround: the include files need to be found
mv ./protoc3/include/google .
sudo -E rm -rf protoc3.zip protoc3
- name: Setup Swagger
run: |
mkdir ${{ env.CODEGEN_ROOT }}
wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar -O ${{ env.SWAGGER_CODEGEN_JAR }}
- name: Execute test_all
run: |
make -C ${{ env.MAGMA_ROOT }}/lte/gateway/python test_all
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # pin@v3
with:
name: Unit Test Results
path: /var/tmp/test_results
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # pin@v2
with:
files: /var/tmp/codecovs/cover_lte.xml,/var/tmp/codecovs/cover_orc8r.xml
flags: lte-test
- name: Extract commit title
if: failure() && github.event_name == 'push'
id: commit
run: |
str="$(jq '.head_commit.message' $GITHUB_EVENT_PATH)" # get the head_commit message
echo ::set-output name=title::${str%%\\n*} | tr -d '"'
- name: Notify failure to slack
if: failure() && github.event_name == 'push'
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 # pin@v2.2.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_CI }}
SLACK_TITLE: "Github action lte-test update failed"
SLACK_USERNAME: "AGW workflow"
SLACK_MESSAGE: "${{ steps.commit.outputs.title}}"
SLACK_ICON_EMOJI: ":boom:"
SLACK_COLOR: "#FF0000"
SLACK_FOOTER: ' '
c_cpp_unit_tests:
needs: path_filter
if: |
needs.path_filter.outputs.should_not_skip == 'true' &&
github.repository_owner == 'magma' &&
github.ref_name == 'master'
name: C/C++ unit tests with Bazel
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Maximize build space
uses: ./.github/workflows/composite/maximize-build-space
- name: Setup Bazel Base Image
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.BAZEL_BASE_IMAGE }}
options: --pull always
# Run a simple echo command to pull down the image. This makes it a bit more clear how much time is spent on building Magma and not pulling down the image.
run: |
echo "Pulled the devontainer image!"
- name: Create a directory to store XML test results
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
shell: bash
image: ${{ env.BAZEL_BASE_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: -v ${{ github.workspace }}:/workspaces/magma/ -v ${{ github.workspace }}/lte/gateway/configs:/etc/magma
run: |
cd /workspaces/magma
mkdir -p c-cpp-test-results/
echo "created c-cpp-test-results/ directory"
- name: Run `bazel test //orc8r/gateway/c/...:* //lte/gateway/c/...:* --config=asan`
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
shell: bash
image: ${{ env.BAZEL_BASE_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: -v ${{ github.workspace }}:/workspaces/magma/ -v ${{ github.workspace }}/lte/gateway/configs:/etc/magma
run: |
cd /workspaces/magma
bazel/scripts/remote_cache_bazelrc_setup.sh "${{ env.CACHE_KEY }}" "${{ secrets.BAZEL_REMOTE_PASSWORD }}"
bazel test //orc8r/gateway/c/...:* //lte/gateway/c/...:* \
--config=asan \
--test_output=errors \
--profile=Bazel_cpp_unit_tests_profile
TEST_RESULT=$?
# copy out test results
echo "Copying out test result XMLs for testing with ASAN"
find bazel-out/k8-dbg/testlogs/ -name "*.xml" | while IFS= read -r f; do cp "$f" "c-cpp-test-results/asan_${f//\//_}"; done
exit $TEST_RESULT
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # pin@v3
with:
name: Unit Test Results
path: c-cpp-test-results/
- name: Publish bazel profile
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # pin@v3
if: always()
with:
name: Bazel cpp unit tests profile
path: Bazel_cpp_unit_tests_profile
- name: Build space left after run
shell: bash
run: |
echo "Available storage:"
df -h
- name: Notify failure to slack
if: failure() && github.event_name == 'push'
uses: rtCamp/action-slack-notify@v2.2.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_BAZEL_CI }}
SLACK_TITLE: "C/C++ unit tests with Bazel"
SLACK_USERNAME: "agw-workflow"
SLACK_ICON_EMOJI: ":boom:"
SLACK_COLOR: "#FF0000"
SLACK_FOOTER: ' '
MSG_MINIMAL: actions url,commit
li_agent_test:
needs: path_filter
if: ${{ needs.path_filter.outputs.should_not_skip == 'true' }}
name: li agent test job
runs-on: ubuntu-latest
env:
MAGMA_ROOT: "${{ github.workspace }}"
steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Run li agent tests
timeout-minutes: 5
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.DEVCONTAINER_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: --volume ${{ env.MAGMA_ROOT }}:/workspaces/magma --volume ${{ env.MAGMA_ROOT }}/lte/gateway/configs:/etc/magma -e ABC=123
run: |
cd /workspaces/magma/lte/gateway
make test_li_agent
- name: Extract commit title
# yamllint enable
if: failure() && github.event_name == 'push'
id: commit
run: |
str="$(jq '.head_commit.message' $GITHUB_EVENT_PATH)" # get the head_commit message
echo ::set-output name=title::${str%%\\n*} | tr -d '"'
- name: Notify failure to slack
if: failure() && github.event_name == 'push'
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 # pin@v2.2.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_CI }}
SLACK_TITLE: "Github action li_agent_test failed"
SLACK_USERNAME: "AGW workflow"
SLACK_MESSAGE: "${{ steps.commit.outputs.title}}"
SLACK_ICON_EMOJI: ":boom:"
SLACK_COLOR: "#FF0000"
SLACK_FOOTER: ' '
mme_test:
needs: path_filter
if: ${{ needs.path_filter.outputs.should_not_skip == 'true' }}
name: mme test job
runs-on: ubuntu-latest
env:
MAGMA_ROOT: "${{ github.workspace }}"
steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Run sctpd tests with Debug build type
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.DEVCONTAINER_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: --volume ${{ env.MAGMA_ROOT }}:/workspaces/magma --volume ${{ env.MAGMA_ROOT }}/lte/gateway/configs:/etc/magma -e ABC=123
run: |
cd /workspaces/magma/lte/gateway
make test_sctpd BUILD_TYPE=Debug
- name: Run sctpd tests with RelWithDebInfo build type
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.DEVCONTAINER_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: --volume ${{ env.MAGMA_ROOT }}:/workspaces/magma --volume ${{ env.MAGMA_ROOT }}/lte/gateway/configs:/etc/magma -e ABC=123
run: |
cd /workspaces/magma/lte/gateway
make test_sctpd BUILD_TYPE=RelWithDebInfo
- name: Run mme tests with Debug build type
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.DEVCONTAINER_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: --volume ${{ env.MAGMA_ROOT }}:/workspaces/magma --volume ${{ env.MAGMA_ROOT }}/lte/gateway/configs:/etc/magma -e ABC=123
run: |
cd /workspaces/magma/lte/gateway
make test_oai BUILD_TYPE=Debug;
- name: Run mme tests with RelWithDebInfo build type
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.DEVCONTAINER_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: --volume ${{ env.MAGMA_ROOT }}:/workspaces/magma --volume ${{ env.MAGMA_ROOT }}/lte/gateway/configs:/etc/magma -e ABC=123
run: |
cd /workspaces/magma/lte/gateway
make test_oai BUILD_TYPE=RelWithDebInfo;
- name: Extract commit title
# yamllint enable
if: failure() && github.event_name == 'push'
id: commit
run: |
str="$(jq '.head_commit.message' $GITHUB_EVENT_PATH)" # get the head_commit message
echo ::set-output name=title::${str%%\\n*} | tr -d '"'
- name: Notify failure to slack
if: failure() && github.event_name == 'push'
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 # pin@v2.2.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_CI }}
SLACK_TITLE: "Github action mme_test failed"
SLACK_USERNAME: "AGW workflow"
SLACK_MESSAGE: "${{ steps.commit.outputs.title}}"
SLACK_ICON_EMOJI: ":boom:"
SLACK_COLOR: "#FF0000"
SLACK_FOOTER: ' '
c-cpp-codecov:
needs: path_filter
if: ${{ needs.path_filter.outputs.should_not_skip == 'true' }}
name: C / C++ code coverage
runs-on: ubuntu-latest
env:
MAGMA_ROOT: "${{ github.workspace }}"
BRANCH: "${{ github.base_ref }}"
REVISION: "${{ github.sha }}"
steps:
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Maximize build space
uses: ./.github/workflows/composite/maximize-build-space
- name: Setup Devcontainer Image
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.DEVCONTAINER_IMAGE }}
# Run a simple echo command to pull down the image. This makes it a bit more clear how much time is spent on building Magma and not pulling down the image.
run: |
echo "Pulled the devontainer image!"
- name: Setup Bazel Base Image
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.BAZEL_BASE_IMAGE }}
options: --pull always
# Run a simple echo command to pull down the image. This makes it a bit more clear how much time is spent on building Magma and not pulling down the image.
run: |
echo "Pulled the bazel base image!"
bazel # pull down bazel, if bazel download fails we can fail before we do all the lengthy work below
- name: Run codecov with CMake (MME)
if: always()
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.DEVCONTAINER_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: -v ${{ github.workspace }}:/workspaces/magma/ -v ${{ github.workspace }}/lte/gateway/configs:/etc/magma
run: |
cd $MAGMA_ROOT/lte/gateway
make coverage
cp $C_BUILD/coverage.info $MAGMA_ROOT
- name: Run coverage with Bazel (COMMON / SESSIOND / SCTPD / LIAGENT / CONNECTIOND)
if: always()
id: bazel-codecoverage
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.BAZEL_BASE_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: -v ${{ github.workspace }}:/workspaces/magma/ -v ${{ github.workspace }}/lte/gateway/configs:/etc/magma
run: |
cd $MAGMA_ROOT
bazel/scripts/remote_cache_bazelrc_setup.sh "${{ env.CACHE_KEY }}" "${{ secrets.BAZEL_REMOTE_PASSWORD }}"
# Collecting coverage with Bazel can be slow. We can follow this thread to see if this can be improved: https://github.com/bazelbuild/bazel/issues/8178
# Coverage in bazel is flaky for remote caches - the flags below are helping. See GH13026 for details.
# TODO: GH11936 Omit OAI coverage until it is tested. We need to determine what the behavior is for doing both CMake and Bazel based coverage at the same time
bazel coverage \
--profile=Bazel_test_coverage_profile \
--experimental_split_coverage_postprocessing --experimental_fetch_all_coverage_outputs --remote_download_outputs=all \
-- //orc8r/gateway/c/...:* //lte/gateway/c/...:* -//lte/gateway/c/core/...:*
# copy out coverage information into magma so that it's accessible from the CI node
cp bazel-out/_coverage/_coverage_report.dat $MAGMA_ROOT
- name: Upload code coverage
if: always()
id: c-cpp-codecov-upload
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # pin@v2
with:
flags: c_cpp
- name: Publish bazel profile
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # pin@v3
if: |
always() &&
github.repository_owner == 'magma' &&
github.ref_name == 'master'
with:
name: Bazel test coverage profile
path: Bazel_test_coverage_profile
- name: Extract commit title
# yamllint enable
if: failure() && github.event_name == 'push'
id: commit
run: |
str="$(jq '.head_commit.message' $GITHUB_EVENT_PATH)" # get the head_commit message
echo ::set-output name=title::${str%%\\n*} | tr -d '"'
- name: Notify failure to slack
if: steps.c-cpp-codecov-upload.outcome=='failure' && github.event_name == 'push'
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 # pin@v2.2.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_CI }}
SLACK_TITLE: "Github action c-cpp-codecov-upload failed"
SLACK_USERNAME: "AGW workflow"
SLACK_MESSAGE: "${{ steps.commit.outputs.title}}"
SLACK_ICON_EMOJI: ":boom:"
SLACK_COLOR: "#FF0000"
SLACK_FOOTER: ' '
- name: Build space left after run
shell: bash
run: |
echo "Available storage:"
df -h
- name: Notify Bazel failure to slack
if: failure() && steps.bazel-codecoverage.conclusion == 'failure' && github.event_name == 'push'
uses: rtCamp/action-slack-notify@v2.2.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_BAZEL_CI }}
SLACK_TITLE: "C / C++ code coverage with Bazel"
SLACK_USERNAME: "agw-workflow"
SLACK_ICON_EMOJI: ":boom:"
SLACK_COLOR: "#FF0000"
SLACK_FOOTER: ' '
MSG_MINIMAL: actions url,commit
lint-clang-format:
needs: path_filter
if: ${{ needs.path_filter.outputs.should_not_skip == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Check clang-format for orc8r/gateway/c
uses: DoozyX/clang-format-lint-action@9ea72631b74e61ce337d0839a90e76180e997283 # pin@v0.13
with:
source: 'orc8r/gateway/c'
extensions: 'h,hpp,c,cpp'
clangFormatVersion: 11.1.0
# taken from .clang-format
style: file
- name: Check clang-format for lte/gateway
uses: DoozyX/clang-format-lint-action@9ea72631b74e61ce337d0839a90e76180e997283 # pin@v0.13
with:
source: 'lte/gateway/c lte/gateway/python'
extensions: 'h,hpp,c,cpp'
clangFormatVersion: 11.1.0
# taken from .clang-format
style: file
session_manager_test:
needs: path_filter
if: ${{ needs.path_filter.outputs.should_not_skip == 'true' }}
name: session manager test job
runs-on: ubuntu-latest
env:
MAGMA_ROOT: "${{ github.workspace }}"
steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Run session_manager tests
timeout-minutes: 20
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
image: ${{ env.DEVCONTAINER_IMAGE }}
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
options: --volume ${{ env.MAGMA_ROOT }}:/workspaces/magma --volume ${{ env.MAGMA_ROOT }}/lte/gateway/configs:/etc/magma
run: |
cd /workspaces/magma/lte/gateway
make test_session_manager
- name: Extract commit title
# yamllint enable
if: failure() && github.event_name == 'push'
id: commit
run: |
str="$(jq '.head_commit.message' $GITHUB_EVENT_PATH)" # get the head_commit message
echo ::set-output name=title::${str%%\\n*} | tr -d '"'
- name: Notify failure to slack
if: failure() && github.event_name == 'push'
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 # pin@v2.2.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_CI }}
SLACK_TITLE: "Github action session_manager_test failed"
SLACK_USERNAME: "AGW workflow"
SLACK_MESSAGE: "${{ steps.commit.outputs.title}}"
SLACK_ICON_EMOJI: ":boom:"
SLACK_COLOR: "#FF0000"
SLACK_FOOTER: ' '
jsonlint-mconfig:
name: jsonlint-mconfig
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- name: jsonlint-mconfig
run: find . -name gateway.mconfig -print0 | xargs --max-args=1 --null --replace='%' sh -c ">/dev/null jq . % || { echo % is not a valid json file; exit 1; } "