From 0744d93ed550dfb85af1d8cbe3b18e5e5d02b290 Mon Sep 17 00:00:00 2001 From: emekoi Date: Sat, 11 Apr 2020 19:58:48 -0500 Subject: [PATCH] added CI job for mingw --- ci/azure/pipelines.yml | 12 +++++++++-- ci/azure/windows_mingw_script | 21 +++++++++++++++++++ .../{windows_install => windows_msvc_install} | 0 ...ows_script.bat => windows_msvc_script.bat} | 2 +- 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 ci/azure/windows_mingw_script rename ci/azure/{windows_install => windows_msvc_install} (100%) mode change 100755 => 100644 rename ci/azure/{windows_script.bat => windows_msvc_script.bat} (94%) diff --git a/ci/azure/pipelines.yml b/ci/azure/pipelines.yml index 5dbfe5a338..fdf9d92d7d 100644 --- a/ci/azure/pipelines.yml +++ b/ci/azure/pipelines.yml @@ -28,12 +28,20 @@ jobs: - job: BuildWindows pool: vmImage: 'windows-2019' + strategy: + matrix: + mingw64: + CHERE_INVOKING: yes + MSYSTEM: MINGW64 + SCRIPT: '%CD:~0,2%\msys64\usr\bin\bash -lc "bash ci/azure/windows_mingw_script"' + msvc: + SCRIPT: ci/azure/windows_msvc_script.bat timeoutInMinutes: 360 steps: - script: | - git clone https://github.com/lazka/msys2-ci-base.git %CD:~0,2%\msys64 + git clone https://github.com/msys2/msys2-ci-base.git %CD:~0,2%\msys64 %CD:~0,2%\msys64\usr\bin\rm -rf %CD:~0,2%\msys64\.git set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu @@ -41,7 +49,7 @@ jobs: - task: DownloadSecureFile@1 inputs: secureFile: s3cfg - - script: ci/azure/windows_script.bat + - script: $(SCRIPT) name: main displayName: 'Build and test' - job: OnMasterSuccess diff --git a/ci/azure/windows_mingw_script b/ci/azure/windows_mingw_script new file mode 100644 index 0000000000..7883766427 --- /dev/null +++ b/ci/azure/windows_mingw_script @@ -0,0 +1,21 @@ +#!/bin/sh + +set -x +set -e + +pacman --noconfirm --needed -S git base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-clang mingw-w64-x86_64-lld mingw-w64-x86_64-llvm + +git config core.abbrev 9 + +ZIGBUILDDIR="$(pwd)/build" +PREFIX="$ZIGBUILDDIR/dist" +CMAKEFLAGS="-DCMAKE_COLOR_MAKEFILE=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX -DZIG_STATIC=ON" + +mkdir $ZIGBUILDDIR +cd $ZIGBUILDDIR + +cmake .. -G 'MSYS Makefiles' -DCMAKE_BUILD_TYPE=RelWithDebInfo $CMAKEFLAGS -DCMAKE_EXE_LINKER_FLAGS='-fuse-ld=lld -Wl,/debug,/pdb:zig.pdb' + +make -j$(nproc) install + +./zig build test-behavior -Dskip-non-native -Dskip-release diff --git a/ci/azure/windows_install b/ci/azure/windows_msvc_install old mode 100755 new mode 100644 similarity index 100% rename from ci/azure/windows_install rename to ci/azure/windows_msvc_install diff --git a/ci/azure/windows_script.bat b/ci/azure/windows_msvc_script.bat similarity index 94% rename from ci/azure/windows_script.bat rename to ci/azure/windows_msvc_script.bat index a8ae902de4..b2063a8e5f 100644 --- a/ci/azure/windows_script.bat +++ b/ci/azure/windows_msvc_script.bat @@ -5,7 +5,7 @@ SET "PREVMSYSEM=%MSYSTEM%" set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem" SET "MSYSTEM=MINGW64" -bash -lc "cd ${SRCROOT} && ci/azure/windows_install" || exit /b +bash -lc "cd ${SRCROOT} && ci/azure/windows_msvc_install" || exit /b SET "PATH=%PREVPATH%" SET "MSYSTEM=%PREVMSYSTEM%"