authorgravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2020-04-11 19:58:48-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-12 16:44:29-04:00
log0744d93ed550dfb85af1d8cbe3b18e5e5d02b290
treeae0b555ef95dda9c1ad6cd0ab02089e396e91daa
parent8e9e126d41cbca619a2a4658fb38d10120388e8f

added CI job for mingw


6 files changed, 72 insertions(+), 43 deletions(-)

ci/azure/pipelines.yml+10-2
...@@ -28,12 +28,20 @@ jobs:...@@ -28,12 +28,20 @@ jobs:
28- job: BuildWindows28- job: BuildWindows
29 pool:29 pool:
30 vmImage: 'windows-2019'30 vmImage: 'windows-2019'
31 strategy:
32 matrix:
33 mingw64:
34 CHERE_INVOKING: yes
35 MSYSTEM: MINGW64
36 SCRIPT: '%CD:~0,2%\msys64\usr\bin\bash -lc "bash ci/azure/windows_mingw_script"'
37 msvc:
38 SCRIPT: ci/azure/windows_msvc_script.bat
3139
32 timeoutInMinutes: 36040 timeoutInMinutes: 360
3341
34 steps:42 steps:
35 - script: |43 - script: |
36 git clone https://github.com/lazka/msys2-ci-base.git %CD:~0,2%\msys6444 git clone https://github.com/msys2/msys2-ci-base.git %CD:~0,2%\msys64
37 %CD:~0,2%\msys64\usr\bin\rm -rf %CD:~0,2%\msys64\.git45 %CD:~0,2%\msys64\usr\bin\rm -rf %CD:~0,2%\msys64\.git
38 set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem46 set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
39 %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu47 %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu
...@@ -41,7 +49,7 @@ jobs:...@@ -41,7 +49,7 @@ jobs:
41 - task: DownloadSecureFile@149 - task: DownloadSecureFile@1
42 inputs:50 inputs:
43 secureFile: s3cfg51 secureFile: s3cfg
44 - script: ci/azure/windows_script.bat52 - script: $(SCRIPT)
45 name: main53 name: main
46 displayName: 'Build and test'54 displayName: 'Build and test'
47- job: OnMasterSuccess55- job: OnMasterSuccess
ci/azure/windows_install deleted-10
...@@ -1,10 +0,0 @@
1#!/bin/sh
2
3set -x
4set -e
5
6pacman -Su --needed --noconfirm
7pacman -S --needed --noconfirm wget p7zip python3-pip
8pip install s3cmd
9wget -nv "https://ziglang.org/deps/llvm%2bclang%2blld-10.0.0-x86_64-windows-msvc-release-mt.tar.xz"
10tar xf llvm+clang+lld-10.0.0-x86_64-windows-msvc-release-mt.tar.xz
ci/azure/windows_mingw_script created+21
...@@ -0,0 +1,21 @@
1#!/bin/sh
2
3set -x
4set -e
5
6pacman --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
7
8git config core.abbrev 9
9
10ZIGBUILDDIR="$(pwd)/build"
11PREFIX="$ZIGBUILDDIR/dist"
12CMAKEFLAGS="-DCMAKE_COLOR_MAKEFILE=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX -DZIG_STATIC=ON"
13
14mkdir $ZIGBUILDDIR
15cd $ZIGBUILDDIR
16
17cmake .. -G 'MSYS Makefiles' -DCMAKE_BUILD_TYPE=RelWithDebInfo $CMAKEFLAGS -DCMAKE_EXE_LINKER_FLAGS='-fuse-ld=lld -Wl,/debug,/pdb:zig.pdb'
18
19make -j$(nproc) install
20
21./zig build test-behavior -Dskip-non-native -Dskip-release
ci/azure/windows_msvc_install created+10
...@@ -0,0 +1,10 @@
1#!/bin/sh
2
3set -x
4set -e
5
6pacman -Su --needed --noconfirm
7pacman -S --needed --noconfirm wget p7zip python3-pip
8pip install s3cmd
9wget -nv "https://ziglang.org/deps/llvm%2bclang%2blld-10.0.0-x86_64-windows-msvc-release-mt.tar.xz"
10tar xf llvm+clang+lld-10.0.0-x86_64-windows-msvc-release-mt.tar.xz
ci/azure/windows_msvc_script.bat created+31
...@@ -0,0 +1,31 @@
1@echo on
2SET "SRCROOT=%cd%"
3SET "PREVPATH=%PATH%"
4SET "PREVMSYSEM=%MSYSTEM%"
5
6set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
7SET "MSYSTEM=MINGW64"
8bash -lc "cd ${SRCROOT} && ci/azure/windows_msvc_install" || exit /b
9SET "PATH=%PREVPATH%"
10SET "MSYSTEM=%PREVMSYSTEM%"
11
12SET "ZIGBUILDDIR=%SRCROOT%\build"
13SET "ZIGINSTALLDIR=%ZIGBUILDDIR%\dist"
14SET "ZIGPREFIXPATH=%SRCROOT%\llvm+clang+lld-10.0.0-x86_64-windows-msvc-release-mt"
15
16call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
17
18REM Make the `zig version` number consistent.
19REM This will affect the cmake command below.
20git.exe config core.abbrev 9
21
22mkdir %ZIGBUILDDIR%
23cd %ZIGBUILDDIR%
24cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release || exit /b
25msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b
26
27"%ZIGINSTALLDIR%\bin\zig.exe" build test || exit /b
28
29set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
30SET "MSYSTEM=MINGW64"
31bash -lc "cd ${SRCROOT} && ci/azure/windows_upload" || exit /b
ci/azure/windows_script.bat deleted-31
...@@ -1,31 +0,0 @@
1@echo on
2SET "SRCROOT=%cd%"
3SET "PREVPATH=%PATH%"
4SET "PREVMSYSEM=%MSYSTEM%"
5
6set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
7SET "MSYSTEM=MINGW64"
8bash -lc "cd ${SRCROOT} && ci/azure/windows_install" || exit /b
9SET "PATH=%PREVPATH%"
10SET "MSYSTEM=%PREVMSYSTEM%"
11
12SET "ZIGBUILDDIR=%SRCROOT%\build"
13SET "ZIGINSTALLDIR=%ZIGBUILDDIR%\dist"
14SET "ZIGPREFIXPATH=%SRCROOT%\llvm+clang+lld-10.0.0-x86_64-windows-msvc-release-mt"
15
16call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
17
18REM Make the `zig version` number consistent.
19REM This will affect the cmake command below.
20git.exe config core.abbrev 9
21
22mkdir %ZIGBUILDDIR%
23cd %ZIGBUILDDIR%
24cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release || exit /b
25msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b
26
27"%ZIGINSTALLDIR%\bin\zig.exe" build test || exit /b
28
29set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
30SET "MSYSTEM=MINGW64"
31bash -lc "cd ${SRCROOT} && ci/azure/windows_upload" || exit /b