Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: s3rj1k <evasive.gyron@gmail.com>
  • Loading branch information
s3rj1k committed Jul 29, 2024
1 parent 6dfe8be commit e7582e9
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 188 deletions.
198 changes: 10 additions & 188 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,197 +12,19 @@ on:
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:
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
env:
REPOTOKEN: ${{ secrets.REPOTOKEN }}
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 logs && (mv log_run-tests_*.html logs || true) && (mv backtrace_*.txt logs || true)
./collect-test-logs.sh
- 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
uses: ./.github/workflows/unit-test.yml
with:
total-groups: 2
current-group: 1
secrets: inherit

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:
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
env:
REPOTOKEN: ${{ secrets.REPOTOKEN }}
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 logs && (mv log_run-tests_*.html logs || true) && (mv backtrace_*.txt logs || true)
./collect-test-logs.sh
- 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
uses: ./.github/workflows/unit-test.yml
with:
total-groups: 2
current-group: 2
secrets: inherit

scan-build:
runs-on: ubuntu-latest
Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Unit tests

on:
workflow_call:
inputs:
total-groups:
description: 'Total number of test groups'
required: true
type: number
current-group:
description: 'Current test group number'
required: true
type: number

jobs:
unit-tests:
name: "unit-tests (group ${{ inputs.current-group }})"
runs-on: ubuntu-latest
container:
image: signalwire/freeswitch-public-base:bookworm
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
options: --privileged
env:
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
env:
REPOTOKEN: ${{ secrets.REPOTOKEN }}
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 ${{ inputs.total-groups }} ${{ inputs.current-group }}
mkdir logs && (mv log_run-tests_*.html logs || true) && (mv backtrace_*.txt logs || true)
./collect-test-logs.sh
- name: Notify result
if: failure()
uses: signalwire/actions-template/.github/actions/notify-ci-result@main
with:
for: "run_tests"
test_logs_path: /__w/freeswitch/freeswitch/tests/unit

0 comments on commit e7582e9

Please sign in to comment.