-
Notifications
You must be signed in to change notification settings - Fork 582
125 lines (107 loc) · 3.82 KB
/
unittests.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
# This is a basic workflow to help you get started with Actions
name: Unit Tests
# Controls when the action will run.
on:
# Triggers the workflow on all push or pull request events
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build_and_test:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
continue-on-error: true
env:
COMPILER: ${{ matrix.compiler }}
BUILD_OS: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
compiler: ['gcc', 'clang', 'gcc-9', 'gcc-10', 'clang-9', 'clang-10']
os: [ubuntu-20.04]
include:
- compiler: 'gcc'
os: ubuntu-22.04
- compiler: 'clang'
os: ubuntu-22.04
- compiler: 'gcc-11'
os: ubuntu-22.04
- compiler: 'gcc-12'
os: ubuntu-22.04
- compiler: 'clang-11'
os: ubuntu-22.04
- compiler: 'clang-12'
os: ubuntu-22.04
- compiler: 'clang-13'
os: ubuntu-22.04
- compiler: 'clang-14'
os: ubuntu-22.04
- compiler: 'clang-15'
os: ubuntu-22.04
- compiler: 'gcc-arm64-qemu-cross'
os: ubuntu-22.04
- compiler: 'gcc-arm32-qemu-cross'
os: ubuntu-22.04
- compiler: 'clang-arm64-qemu-cross'
os: ubuntu-22.04
- compiler: 'clang-arm32-qemu-cross'
os: ubuntu-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache the compiler cache
uses: actions/cache@v4
if: endsWith(matrix.compiler, '-qemu-cross')
with:
path: ccache
key: ccache-ut-${{ matrix.os }}-${{ matrix.compiler }}-${{ github.run_id }}
restore-keys: |
ccache-ut-${{ matrix.os }}-${{ matrix.compiler }}
- name: Start Docker container
if: endsWith(matrix.compiler, '-cross')
run: sh -x scripts/build/start_container.sh
- name: Install dependencies
run: |
sh -x scripts/build/reset_sources.sh
sh -x scripts/build/install_depends.sh
- name: Get libtap
run: git clone https://github.com/zorgnax/libtap.git lib/libtap
- name: Zero out compiler cache stats
if: endsWith(matrix.compiler, '-qemu-cross')
run: scripts/build/zero_ccache_stats.sh
- name: Build libtap
run: sh -x scripts/build/build_libtap.sh lib/libtap
- name: Build test harness
run: sh -x scripts/build/build_test_harness.sh lib/libtap
- name: Print compiler cache stats
if: endsWith(matrix.compiler, '-qemu-cross')
run: scripts/build/print_ccache_stats.sh
- name: Run tests
env:
MAKE_TGT: 'test'
run: script -e unit_tests.log -c 'sh -x scripts/build/do_build.sh DEFS_EXTRA_OPTS="-DUNIT_TESTS -fPIE -fPIC"'
- name: Collect test logs
uses: actions/upload-artifact@v4
with:
name: unit_tests-logs_${{ matrix.os }}_${{ matrix.compiler }}
path: |
unit_tests.log
notify:
runs-on: ubuntu-latest
needs: build_and_test
steps:
- name: Notify slack fail
if: failure() && github.repository == 'OpenSIPS/opensips'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: devel
status: FAILED
color: danger