Skip to content

Commit

Permalink
[GHA] Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rj1k committed Jul 25, 2024
1 parent 8f9939b commit dafd791
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: CI

on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize

jobs:
unit-tests:
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
- 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) 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) install || true
- name: Run tests
shell: bash
working-directory: /__w/freeswitch/freeswitch/tests/unit
run: |
./run-tests.sh
ls -la /cores
mkdir logs && (mv log_run-tests_*.html logs || true) && (mv backtrace_*.txt logs || true)
echo 0 > run-tests-status.txt
./collect-test-logs.sh

0 comments on commit dafd791

Please sign in to comment.