set up github workflow for build and basic test

pull/42/head
drowe67 2021-12-31 13:21:49 +10:30 committed by David Rowe
parent 9bffd903d9
commit 67effb03ac
2 changed files with 46 additions and 40 deletions

46
.github/workflows/cmake.yml vendored 100644
View File

@ -0,0 +1,46 @@
name: CMake
on: [pull_request]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install packages
shell: bash
run: |
sudo apt-get update
sudo apt-get install octave octave-common octave-signal lgnuplot sox p7zip-full
- name: Create Build Directory
shell: bash
run: mkdir $GITHUB_WORKSPACE/build_linux
- name: Configure codec2 CMake
shell: bash
working-directory: ${{github.workspace}}/build_linux
run: cmake $GITHUB_WORKSPACE
- name: Build codec2
working-directory: ${{github.workspace}}/build_linux
shell: bash
run: make -j4
- name: Build LPCNet
shell: bash
run: |
cd $HOME
git clone https://github.com/drowe67/LPCNet.git
cd LPCNet && mkdir -p build_linux && cd build_linux
cmake -DCODEC2_BUILD_DIR=$GITHUB_WORKSPACE/build_linux ..
make
# simple test to make sure the code runs
cd src && sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s > /dev/null

View File

@ -1,40 +0,0 @@
sudo: required
language: generic
dist: xenial
addons:
apt:
packages:
libc6-i386
libspeexdsp-dev
libsamplerate0-dev
sox
git
octave-common octave gnuplot octave-signal
install:
- export CODEC2DIR=${PWD}/codec2
- export LPCNETDIR=${PWD}
- export BUILDDIR=${PWD}/build_linux
script:
# First build and install vanilla codec2 as we need -lcodec2 to build LPCNet
- git clone https://github.com/drowe67/codec2.git
- cd codec2
- mkdir build_linux && cd build_linux && cmake .. && make
# OK, build and test LPCNet
- cd $LPCNETDIR && mkdir -p $BUILDDIR && cd $BUILDDIR
- cmake -DCODEC2_BUILD_DIR=$CODEC2DIR/build_linux .. && make
# simple sanity check
- cd src && sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s > /dev/null
# some LPCNet ctests
- ls -l
- cd $BUILDDIR && ctest --output-on-failure
# Re-build codec2 with LPCNet and test FreeDV 2020 support
- cd $CODEC2DIR/build_linux
- make clean
- cmake -DLPCNET_BUILD_DIR=$BUILDDIR ..
- make
- cd src
# sanity check
- ./freedv_tx 2020 $LPCNETDIR/wav/wia.wav - | ./freedv_rx 2020 - /dev/null