-
Notifications
You must be signed in to change notification settings - Fork 8
206 lines (189 loc) · 7.12 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
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"