Skip to content

[GHA] Add tests.

[GHA] Add tests. #8

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
jobs:
unit-tests_1:
name: "unit-tests (group 1)"
runs-on: ubuntu-latest
container:
image: signalwire/freeswitch-public-base:bookworm
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
options: --privileged
env:
REPOTOKEN: ${{ secrets.REPOTOKEN }}
DEBIAN_FRONTEND: noninteractive
ASAN_OPTIONS: log_path=stdout:disable_coredump=0:unmap_shadow_on_exit=1:fast_unwind_on_malloc=0
steps:
- name: Override core_pattern
shell: bash
run: |
cat /proc/sys/kernel/core_pattern
echo '/cores/core.%s.%E.%e.%p.%t' > /proc/sys/kernel/core_pattern
cat /proc/sys/kernel/core_pattern
- name: Install dependencies
shell: bash
run: |
echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf && \
apt-get update && \
apt-get -y remove \
libsofia-sip-ua0 \
libspandsp-dev && \
apt-get -y install \
libspandsp3-dev && \
rm -rf /etc/apt/auth.conf
- name: Checkout code
uses: actions/checkout@v4
with:
path: /__w/freeswitch/freeswitch
- name: Bootstrap
shell: bash
working-directory: /__w/freeswitch/freeswitch
run: |
./bootstrap.sh -j || exit 1
- name: Checkout Sofia-Sip
uses: actions/checkout@v4
with:
repository: freeswitch/sofia-sip
path: /__w/freeswitch/freeswitch/sofia-sip
- name: Build sofia-sip
shell: bash
working-directory: /__w/freeswitch/freeswitch/sofia-sip
run: |
./autogen.sh && \
./configure.gnu && \
make -j$(nproc --all) install
- name: Build FreeSwitch
shell: bash
working-directory: /__w/freeswitch/freeswitch
run: |
echo 'codecs/mod_openh264' >> modules.conf && \
sed -i \
-e '/applications\/mod_http_cache/s/^#//g' \
-e '/event_handlers\/mod_rayo/s/^#//g' \
-e '/formats\/mod_opusfile/s/^#//g' \
-e '/languages\/mod_lua/s/^#//g' \
modules.conf && \
./configure \
--enable-address-sanitizer \
--enable-fake-dlclose && \
make -j$(nproc --all) |& tee ./unit-tests-build-result.txt
echo ${PIPESTATUS[0]} > ./build-status.txt
if ! test "$(cat ./build-status.txt | tr -d '[:space:]')" -eq 0; then
exit "$(cat ./build-status.txt | tr -d '[:space:]')"
fi
make install
- name: Run tests
shell: bash
working-directory: /__w/freeswitch/freeswitch/tests/unit
run: |
./run-tests.sh 2 1
mkdir -p logs
find . -maxdepth 1 -regex './log_run-tests_.*\.html' -exec mv {} logs/ \;
find . -maxdepth 1 -regex './backtrace_.*\.txt' -exec mv {} logs/ \;
./collect-test-logs.sh
- name: Print result
shell: bash
working-directory: /__w/freeswitch/freeswitch/tests/unit
run: |
ls -la /cores
find logs -maxdepth 1 -regex 'logs/log_run-tests_.*\.html' -exec cat {} \;
find logs -maxdepth 1 -regex 'logs/backtrace_.*\.txt' -exec cat {} \;
# - name: Notify result
# if: failure()
# uses: signalwire/actions-template/.github/actions/notify-ci-result@main
# with:
# for: "run_tests"
# test_logs_path: /__w/stack/stack/tests/unit
unit-tests_2:
name: "unit-tests (group 2)"
runs-on: ubuntu-latest
container:
image: signalwire/freeswitch-public-base:bookworm
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
options: --privileged
env:
REPOTOKEN: ${{ secrets.REPOTOKEN }}
DEBIAN_FRONTEND: noninteractive
ASAN_OPTIONS: log_path=stdout:disable_coredump=0:unmap_shadow_on_exit=1:fast_unwind_on_malloc=0
steps:
- name: Override core_pattern
shell: bash
run: |
cat /proc/sys/kernel/core_pattern
echo '/cores/core.%s.%E.%e.%p.%t' > /proc/sys/kernel/core_pattern
cat /proc/sys/kernel/core_pattern
- name: Install dependencies
shell: bash
run: |
echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf && \
apt-get update && \
apt-get -y remove \
libsofia-sip-ua0 \
libspandsp-dev && \
apt-get -y install \
libspandsp3-dev && \
rm -rf /etc/apt/auth.conf
- name: Checkout code
uses: actions/checkout@v4
with:
path: /__w/freeswitch/freeswitch
- name: Bootstrap
shell: bash
working-directory: /__w/freeswitch/freeswitch
run: |
./bootstrap.sh -j || exit 1
- name: Checkout Sofia-Sip
uses: actions/checkout@v4
with:
repository: freeswitch/sofia-sip
path: /__w/freeswitch/freeswitch/sofia-sip
- name: Build sofia-sip
shell: bash
working-directory: /__w/freeswitch/freeswitch/sofia-sip
run: |
./autogen.sh && \
./configure.gnu && \
make -j$(nproc --all) install
- name: Build FreeSwitch
shell: bash
working-directory: /__w/freeswitch/freeswitch
run: |
echo 'codecs/mod_openh264' >> modules.conf && \
sed -i \
-e '/applications\/mod_http_cache/s/^#//g' \
-e '/event_handlers\/mod_rayo/s/^#//g' \
-e '/formats\/mod_opusfile/s/^#//g' \
-e '/languages\/mod_lua/s/^#//g' \
modules.conf && \
./configure \
--enable-address-sanitizer \
--enable-fake-dlclose && \
make -j$(nproc --all) |& tee ./unit-tests-build-result.txt
echo ${PIPESTATUS[0]} > ./build-status.txt
if ! test "$(cat ./build-status.txt | tr -d '[:space:]')" -eq 0; then
exit "$(cat ./build-status.txt | tr -d '[:space:]')"
fi
make install
- name: Run tests
shell: bash
working-directory: /__w/freeswitch/freeswitch/tests/unit
run: |
./run-tests.sh 2 2
mkdir -p logs
find . -maxdepth 1 -regex './log_run-tests_.*\.html' -exec mv {} logs/ \;
find . -maxdepth 1 -regex './backtrace_.*\.txt' -exec mv {} logs/ \;
./collect-test-logs.sh
- name: Print result
shell: bash
working-directory: /__w/freeswitch/freeswitch/tests/unit
run: |
ls -la /cores
find logs -maxdepth 1 -regex 'logs/log_run-tests_.*\.html' -exec cat {} \;
find logs -maxdepth 1 -regex 'logs/backtrace_.*\.txt' -exec cat {} \;
# - name: Notify result
# if: failure()
# uses: signalwire/actions-template/.github/actions/notify-ci-result@main
# with:
# for: "run_tests"
# test_logs_path: /__w/stack/stack/tests/unit
scan-build:
runs-on: ubuntu-latest
container:
image: signalwire/freeswitch-public-base:bookworm
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
options: --privileged
env:
REPOTOKEN: ${{ secrets.REPOTOKEN }}
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install dependencies
shell: bash
run: |
echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf && \
apt-get update && \
apt-get -y remove \
libsofia-sip-ua0 \
libspandsp-dev && \
apt-get -y install \
autoconf \
libsofia-sip-ua-dev \
libspandsp3-dev && \
rm -rf /etc/apt/auth.conf
- name: Checkout code
uses: actions/checkout@v4
with:
path: /__w/freeswitch/freeswitch
- name: Bootstrap
shell: bash
working-directory: /__w/freeswitch/freeswitch
run: |
./bootstrap.sh -j || exit 1
- name: Scan-build FreeSwitch
shell: bash
working-directory: /__w/freeswitch/freeswitch
run: |
cp build/modules.conf.most modules.conf && \
echo 'codecs/mod_openh264' >> modules.conf && \
sed -i \
-e '/mod_mariadb/s/^#//g' \
-e '/mod_v8/s/^#//g' \
-e '/mod_ilbc/s/^/#/g' \
-e '/mod_isac/s/^/#/g' \
-e '/mod_mp4/s/^/#/g' \
-e '/mod_mongo/s/^/#/g' \
-e '/mod_pocketsphinx/s/^/#/g' \
-e '/mod_sangoma_codec/s/^/#/g' \
-e '/mod_siren/s/^/#/g' \
-e '/mod_avmd/s/^/#/g' \
-e '/mod_basic/s/^/#/g' \
-e '/mod_cdr_mongodb/s/^/#/g' \
-e '/mod_cv/s/^/#/g' \
-e '/mod_erlang_event/s/^/#/g' \
-e '/mod_perl/s/^/#/g' \
-e '/mod_rtmp/s/^/#/g' \
-e '/mod_unimrcp/s/^/#/g' \
-e '/mod_xml_rpc/s/^/#/g' \
modules.conf && \
./configure && \
./scan_build.sh