GitLab CI: Add a Visual Studio code analysis step.

Add a Windows template.
This commit is contained in:
Gerald Combs 2021-04-05 11:35:23 -07:00 committed by Wireshark GitLab Utility
parent 0d202254f8
commit 156737db0f
1 changed files with 42 additions and 26 deletions

View File

@ -80,6 +80,29 @@ variables:
- build/packaging/rpm/RPMS
expire_in: 3 days
.build-windows:
stage: build
before_script:
- mkdir c:\Development
- $env:WIRESHARK_BASE_DIR = "C:\Development"
- $env:Configuration = "RelWithDebInfo"
- $env:Path += ";C:\Program Files\CMake\bin"
- $env:Path += ";C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin"
- $env:Path += ";C:\qt\5.15.2\msvc2019_64\bin"
# https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell
- cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
- Get-Content "$env:temp\vcvars.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
# Testing / debugging only.
# - cmd.exe /c "set CI_PIPELINE_SOURCE"
# - cmd.exe /c "set CI_PROJECT_URL"
#- dir c:\
#- dir c:\qt
#- $env:path.split(";")
#- cmd.exe /c "set"
#- Get-Location
- mkdir build
- cd build
# Rely on fedora:latest and debian-stable jobs for testing a recent GCC version.
clang-11:
extends: .build-ubuntu
@ -214,6 +237,22 @@ test:debian-stable:
needs:
- build:debian-stable
# Windows runners are still beta, at least technically:
# https://docs.gitlab.com/ee/user/gitlab_com/index.html#windows-shared-runners-beta
# Dockerfile at https://github.com/wireshark/wireshark-windows-dev-docker.
build:windows-vs-code-analysis:
extends: .build-windows
tags:
- wireshark-windows-dev
rules:
# The wireshark-windows-* tags are only available in wireshark/wireshark.
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
when: always
script:
- $env:caexcludepath = "C:\Qt;$env:INCLUDE"
- cmake -DENABLE_CODE_ANALYSIS=ON -G "Visual Studio 16 2019" -A x64 -DENABLE_LTO=off ..
- msbuild /verbosity:minimal "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount:2 Wireshark.sln
# Build Wireshark manuals
# Note: Need ubuntu:focal with `ruby-coderay` and `ruby-asciidoctor-pdf` packages to build PDF docs
docbook:
@ -334,41 +373,18 @@ merge-req:ubuntu-clang-other-tests:
- item_calls_check.txt
- tfs_check.txt
# XXX This is still beta:
# Windows runners are still beta, at least technically:
# https://docs.gitlab.com/ee/user/gitlab_com/index.html#windows-shared-runners-beta
# Dockerfile at https://github.com/wireshark/wireshark-windows-dev-docker.
# XXX We currently depend on Qt being installed in C:\Qt on the host. We should
# find a more independent way of installing Qt, e.g. via a download+cache.
merge-req:windows:
extends: .build-windows
tags:
- wireshark-windows-merge-req
stage: build
rules:
# The wireshark-windows-dev image is only available via a dedicated runner.
# The wireshark-windows-* tags are only available in wireshark/wireshark.
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_PROJECT_URL =~ /.*gitlab.com\/wireshark\/wireshark/'
when: always
before_script:
# XXX Find a better location.
- cmd.exe /c "set CI_PIPELINE_SOURCE"
- cmd.exe /c "set CI_PROJECT_URL"
- mkdir c:\Development
- $env:WIRESHARK_BASE_DIR = "C:\Development"
- $env:Configuration = "RelWithDebInfo"
- $env:Path += ";C:\Program Files\CMake\bin"
- $env:Path += ";C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin"
- $env:Path += ";C:\qt\5.15.2\msvc2019_64\bin"
# https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell
- cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
- Get-Content "$env:temp\vcvars.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
# Testing / debugging only.
#- dir c:\
#- dir c:\qt
#- $env:path.split(";")
#- cmd.exe /c "set"
#- Get-Location
script:
- mkdir build
- cd build
- cmake -G "Visual Studio 16 2019" -A x64 -DENABLE_LTO=off ..
- msbuild /verbosity:minimal "/consoleloggerparameters:PerformanceSummary;NoSummary" /maxcpucount Wireshark.sln
- msbuild /verbosity:minimal test-programs.vcxproj