forked from TokTok/c-toxcore
-
-
Notifications
You must be signed in to change notification settings - Fork 5
94 lines (88 loc) · 3.11 KB
/
amalgamation_test_win64.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
name: amalgamation_test_win64
on:
push:
pull_request:
jobs:
amalgamation_test_win64:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
export ARCH=x86_64
export WINEARCH=win64
sudo apt-get update && \
sudo DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates \
cmake \
extra-cmake-modules \
git \
libarchive-tools \
libtool \
nsis \
pkg-config \
texinfo \
unzip \
wget \
yasm \
zip \
wine \
g++-mingw-w64-${ARCH//_/-} \
gcc-mingw-w64-${ARCH//_/-}
sudo update-alternatives --set ${ARCH}-w64-mingw32-gcc /usr/bin/${ARCH}-w64-mingw32-gcc-posix
sudo update-alternatives --set ${ARCH}-w64-mingw32-g++ /usr/bin/${ARCH}-w64-mingw32-g++-posix
- name: compile static libsodium
run: |
export ARCH=x86_64
export WINEARCH=win64
HOME=$(pwd)
echo "HOMEDIR=$HOME"
export PKG_CONFIG_PATH="$HOME/inst/lib/pkgconfig"
mkdir -p "$HOME"/sodium/
mkdir -p "$HOME"/inst/
cd "$HOME"/sodium/
rm -f libsodium.tgz
rm -Rf libsodium-*
SODIUM_VERSION=1.0.19
wget "https://github.com/jedisct1/libsodium/releases/download/${SODIUM_VERSION}-RELEASE/libsodium-${SODIUM_VERSION}.tar.gz" -O libsodium.tgz
tar -xzvf libsodium.tgz
cd libsodium-*
MINGW_ARCH="x86_64"
HOST_OPTION="--host=${MINGW_ARCH}-w64-mingw32"
CROSS_LDFLAG=""
CROSS_CFLAG=""
CROSS_CPPFLAG=""
CFLAGS="${CROSS_CFLAG}" \
LDFLAGS="${CROSS_LDFLAG} -fstack-protector" \
./configure "${HOST_OPTION}" \
"--prefix=$HOME/inst/" \
--disable-shared \
--enable-static
make -j $(nproc)
make install
- name: compile test without ToxAV
run: |
export ARCH=x86_64
export WINEARCH=win64
HOME=$(pwd)
export PKG_CONFIG_PATH="$HOME/inst/lib/pkgconfig"
cd "$HOME"/amalgamation/
${ARCH}-w64-mingw32-gcc -static -O3 amalgamation_test.c $(pkg-config --cflags --libs libsodium) -lwinpthread -lwsock32 -lws2_32 -liphlpapi -o amalgamation_test
- name: check binary without ToxAV
run: |
HOME=$(pwd)
cd "$HOME"/amalgamation/
file amalgamation_test.exe
ls -al amalgamation_test.exe
ls -hal amalgamation_test.exe
- name: Run the test without ToxAV
run: |
export ARCH=x86_64
export WINEARCH=win64
HOME=$(pwd)
cd "$HOME"/amalgamation/
wine ./amalgamation_test.exe