Skip to content

toxcore amalgamation #67

toxcore amalgamation

toxcore amalgamation #67

Workflow file for this run

name: test
on:
push:
pull_request:
jobs:
update-nightly-tag:
name: Update nightly release tag
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Move nightly tag to head for nightly release
run: git tag -f nightly && git push origin nightly -f
build:
name: Build
runs-on: ubuntu-20.04
needs: [update-nightly-tag]
if: |
always() &&
(needs.update-nightly-tag.result == 'success' ||
needs.update-nightly-tag.result == 'skipped')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt-get update && \
sudo DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
zip grep file ca-certificates autotools-dev autoconf automake \
git bc wget rsync cmake make pkg-config yasm libtool \
libasound2-dev libv4l-dev ssh gzip tar \
python3-pip python3-distutils \
ca-certificates \
libconfig-dev \
libopus-dev \
libsodium-dev \
libvpx-dev \
pkg-config \
libavutil-dev \
libavcodec-dev \
libavformat-dev \
libavdevice-dev \
libavfilter-dev \
libswresample-dev \
libswscale-dev \
libx264-dev \
libx11-dev \
libsdl2-dev
- name: check for python3
run: |
python3 --version
- name: pwd
run: |
ls -al
pwd
- name: install python deps
run: |
python3 -m pip install evdev
- name: test-python-script
run: |
mkdir -p _test_python_/
cd _test_python_/;ls -al ../toxblinkenwall/ext_keys_scripts/ext_keys_evdev.py;sleep 15;python3 ../toxblinkenwall/ext_keys_scripts/ext_keys_evdev.py > log.txt 2> log.txt &
- name: test-python-script-reader
uses: nick-fields/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
retry_on: error
command: |
cd _test_python_/; mkfifo ../ext_keys.fifo;sleep 10; if [ -s log.txt ]; then ls -al log.txt;echo "python script ERROR"; cat log.txt;exit 1; fi
- name: build included toxcore amalgamation
run: |
pwd
cd toxcore/
make
ls -al
- name: compile binary for Linux with SDL
run: |
mkdir -p build_dir/
cd build_dir/
pwd
cp -av ../toxblinkenwall/toxblinkenwall.c ./
cp -av ../toxblinkenwall/rb.c ./
cp -av ../toxblinkenwall/rb.h ./
cp -av ../toxblinkenwall/stb_image_resize.h ./
ls -al
# sed -i -e 's/#define HAVE_OUTPUT_OPENGL /#define HAVE_FRAMEBUFFER /' toxblinkenwall.c
# sed -i -e 's/#define HAVE_OUTPUT_OMX /#define HAVE_FRAMEBUFFER /' toxblinkenwall.c
# sed -i -e 'sx^// #define HAVE_X11_AS_FB 1x#define HAVE_X11_AS_FB 1x' toxblinkenwall.c
cat toxblinkenwall.c|grep 'define HAVE_OUTPUT_OPENGL'||echo _
cat toxblinkenwall.c|grep 'define HAVE_OUTPUT_OMX'||echo _
cat toxblinkenwall.c|grep 'define HAVE_FRAMEBUFFER'||echo _
cat toxblinkenwall.c|grep 'define HAVE_X11_AS_FB'||echo _
# make certain warnings into errors!
WARNS=' -Werror=implicit-function-declaration -Werror=div-by-zero -Werror=sign-compare -Werror=format=2 -Werror=int-conversion -Werror=implicit-function-declaration '
IGNRS=' -Wno-error=format-truncation= '
gcc \
-O3 -g \
$WARNS $IGNRS \
-fstack-protector-all \
-Wno-unused-variable \
-fPIC -export-dynamic -I./ \
-o toxblinkenwall \
-lm \
toxblinkenwall.c rb.c \
-std=gnu99 \
-I../toxcore \
../toxcore/libtoxcore.a \
$(pkg-config --cflags --libs libsodium libswresample opus vpx libavcodec libswscale libavformat libavdevice libavutil x264) \
$(pkg-config --cflags --libs sdl2) \
-pthread \
-lrt \
-lasound \
-lm \
-lv4lconvert || exit 1
res2=$?
ldd toxblinkenwall
ls -hal toxblinkenwall
file toxblinkenwall
cp -av toxblinkenwall toxblinkenwall_linux_sdl
- name: compile binary for Linux Framebuffer
run: |
mkdir -p build_dir/
cd build_dir/
pwd
cp -av ../toxblinkenwall/toxblinkenwall.c ./
cp -av ../toxblinkenwall/rb.c ./
cp -av ../toxblinkenwall/rb.h ./
cp -av ../toxblinkenwall/stb_image_resize.h ./
ls -al
sed -i -e 's/#define HAVE_OUTPUT_OPENGL /#define HAVE_FRAMEBUFFER /' toxblinkenwall.c
sed -i -e 's/#define HAVE_OUTPUT_OMX /#define HAVE_FRAMEBUFFER /' toxblinkenwall.c
sed -i -e 's/#define HAVE_SDLVIDEO_OUT /#define HAVE_FRAMEBUFFER /' toxblinkenwall.c
cat toxblinkenwall.c|grep 'define HAVE_OUTPUT_OPENGL'||echo _
cat toxblinkenwall.c|grep 'define HAVE_OUTPUT_OMX'||echo _
cat toxblinkenwall.c|grep 'define HAVE_FRAMEBUFFER'||echo _
cat toxblinkenwall.c|grep 'define HAVE_X11_AS_FB'||echo _
# make certain warnings into errors!
WARNS=' -Werror=implicit-function-declaration -Werror=div-by-zero -Werror=sign-compare -Werror=format=2 -Werror=int-conversion -Werror=implicit-function-declaration '
IGNRS=' -Wno-error=format-truncation= '
gcc \
-O3 -g \
$WARNS $IGNRS \
-fstack-protector-all \
-Wno-unused-variable \
-fPIC -export-dynamic -I./ \
-o toxblinkenwall \
-lm \
toxblinkenwall.c rb.c \
-std=gnu99 \
-I../toxcore \
../toxcore/libtoxcore.a \
$(pkg-config --cflags --libs x11 libsodium libswresample opus vpx libavcodec libswscale libavformat libavdevice libavutil x264) \
-pthread \
-lrt \
-lasound \
-lm \
-lv4lconvert || exit 1
res2=$?
ldd toxblinkenwall
ls -hal toxblinkenwall
file toxblinkenwall
cp -av toxblinkenwall toxblinkenwall_linux_fb
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: toxblinkenwall_linux_fb
path: build_dir/toxblinkenwall_linux_fb
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: toxblinkenwall_linux_sdl
path: build_dir/toxblinkenwall_linux_sdl
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "build_dir/toxblinkenwall_linux_fb,build_dir/toxblinkenwall_linux_sdl"