chore: Simplify and speed up windows builds using docker image.

This commit is contained in:
iphydf 2022-02-19 00:41:35 +00:00
parent c44930d323
commit 68f4e5c0fa
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
2 changed files with 20 additions and 43 deletions

View File

@ -1,48 +1,29 @@
#!/bin/bash #!/bin/bash
ACTION="$1"
set -eu set -eu
NPROC=$(nproc) NPROC=$(nproc)
ci_install() { . ".github/scripts/flags-gcc.sh"
docker build \
--build-arg SUPPORT_ARCH_i686="$i686" \
--build-arg SUPPORT_ARCH_x86_64="$x86_64" \
--build-arg SUPPORT_TEST=true \
-t toxcore-"$WINDOWS_ARCH" \
other/docker/windows
}
ci_script() { # Allows wine to display source code file names and line numbers on crash in
. ".github/scripts/flags-gcc.sh" # its backtrace.
add_flag -gdwarf-2
# Allows wine to display source code file names and line numbers on crash in # Fix invalid register for .seh_savexmm error
# its backtrace. add_flag -fno-asynchronous-unwind-tables
add_flag -gdwarf-2
# Fix invalid register for .seh_savexmm error docker run \
add_flag -fno-asynchronous-unwind-tables -e ALLOW_TEST_FAILURE=true \
-e ENABLE_ARCH_i686="$i686" \
docker run \ -e ENABLE_ARCH_x86_64="$x86_64" \
-e ALLOW_TEST_FAILURE=true \ -e ENABLE_TEST=true \
-e ENABLE_ARCH_i686="$i686" \ -e EXTRA_CMAKE_FLAGS="-DBOOTSTRAP_DAEMON=OFF -DMIN_LOGGER_LEVEL=DEBUG -DTEST_TIMEOUT_SECONDS=90 -DAUTOTEST=ON" \
-e ENABLE_ARCH_x86_64="$x86_64" \ -e CMAKE_C_FLAGS="$C_FLAGS" \
-e ENABLE_TEST=true \ -e CMAKE_CXX_FLAGS="$CXX_FLAGS" \
-e EXTRA_CMAKE_FLAGS="-DBOOTSTRAP_DAEMON=OFF -DMIN_LOGGER_LEVEL=DEBUG -DTEST_TIMEOUT_SECONDS=90 -DAUTOTEST=ON" \ -e CMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
-e CMAKE_C_FLAGS="$C_FLAGS" \ -e CMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \
-e CMAKE_CXX_FLAGS="$CXX_FLAGS" \ -v "$PWD:/toxcore" \
-e CMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \ -v "$PWD/result:/prefix" \
-e CMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \ --rm \
-v "$PWD:/toxcore" \ "toxchat/windows:$WINDOWS_ARCH"
-v "$PWD/result:/prefix" \
--rm \
toxcore-"$WINDOWS_ARCH"
}
if [ "-z" "$ACTION" ]; then
"ci_script"
else
"ci_$ACTION"
fi

View File

@ -47,8 +47,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Docker Build
run: .github/scripts/cmake-win32 install
- name: Cross compilation - name: Cross compilation
run: .github/scripts/cmake-win32 script run: .github/scripts/cmake-win32 script
@ -56,8 +54,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Docker Build
run: .github/scripts/cmake-win64 install
- name: Cross compilation - name: Cross compilation
run: .github/scripts/cmake-win64 script run: .github/scripts/cmake-win64 script