update amalgamation #282
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: amalgamation_test_win64 | |
on: | |
push: | |
pull_request: | |
jobs: | |
amalgamation_test_win64: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- 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.18 | |
wget "https://download.libsodium.org/libsodium/releases/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 |