From 022bf68ede317a8f484c20d11a188638bc049f3b Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Tue, 7 Mar 2023 16:39:34 +0200 Subject: [PATCH 1/7] Setup build job for nokia windows runner --- .gitlab-ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d00b37f0a..ac6409a847 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -156,6 +156,11 @@ stages: tags: - ivas-linux +.build-job-windows: + stage: build + timeout: "4 minutes" + tags: + - nokia-windows-runner # template for test jobs on linux that need the TESTV_DIR .test-job-linux-needs-testv-dir: @@ -172,6 +177,12 @@ stages: exit_codes: - 123 +.build-job-windows-with-check-for-warnings: + extends: .build-job-windows + stage: build + allow_failure: + exit_codes: + - 123 # --------------------------------------------------------------- @@ -262,6 +273,16 @@ build-codec-sanitizers-linux: - *print-common-info - bash ci/build_codec_sanitizers_linux.sh +build-codec-windows-cmake: + extends: + - .build-job-windows-with-check-for-warnings + - .rules-basis + script: + - *print-common-info + - cmake -G "Visual Studio 15 2017" . -Bbuild + - cmake --build build -j16 | Out-File -FilePath $BUILD_OUTPUT + - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'", "exit $LASTEXITCODE") | Invoke-Expression + # --------------------------------------------------------------- # Test jobs for merge requests # --------------------------------------------------------------- -- GitLab From 3f6a636da3339d2f73a0b5596be5aae89179e17e Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Tue, 7 Mar 2023 16:43:19 +0200 Subject: [PATCH 2/7] Disable rules-basis for windows build for testing --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac6409a847..8e75aa72b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -276,7 +276,7 @@ build-codec-sanitizers-linux: build-codec-windows-cmake: extends: - .build-job-windows-with-check-for-warnings - - .rules-basis + #- .rules-basis script: - *print-common-info - cmake -G "Visual Studio 15 2017" . -Bbuild -- GitLab From 94dc06dddc6d977fd76b272d980bbe38261a2241 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Tue, 7 Mar 2023 17:26:48 +0200 Subject: [PATCH 3/7] Add windows version of print-common-info --- .gitlab-ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8e75aa72b1..501bd1a8b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,6 +49,13 @@ stages: echo "Commit time was $CI_COMMIT_TIMESTAMP" date | xargs echo "System time is" +.print-common-info-windows: &print-common-info-windows + - | + echo "Printing common information for build job." + echo "Current job is run on commit $CI_COMMIT_SHA" + echo "Commit time was $CI_COMMIT_TIMESTAMP" + ("echo 'System time is'", "Get-Date -Format 'dddd dd/MM/yyyy HH:mm K'") | Invoke-Expression + .get-previous-merge-commit-sha: &get-previous-merge-commit-sha - previous_merge_commit=$(git --no-pager log --merges HEAD~1 -n 1 --pretty=format:%H) @@ -278,7 +285,7 @@ build-codec-windows-cmake: - .build-job-windows-with-check-for-warnings #- .rules-basis script: - - *print-common-info + - *print-common-info-windows - cmake -G "Visual Studio 15 2017" . -Bbuild - cmake --build build -j16 | Out-File -FilePath $BUILD_OUTPUT - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'", "exit $LASTEXITCODE") | Invoke-Expression -- GitLab From ee9406e73ddf4782ac9fd2441c7ac73c8ee4f205 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Tue, 7 Mar 2023 17:33:02 +0200 Subject: [PATCH 4/7] Change windows tag, enable rules-basis for win build --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 501bd1a8b4..0a54c09297 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -167,7 +167,7 @@ stages: stage: build timeout: "4 minutes" tags: - - nokia-windows-runner + - ivas-windows # template for test jobs on linux that need the TESTV_DIR .test-job-linux-needs-testv-dir: @@ -283,7 +283,7 @@ build-codec-sanitizers-linux: build-codec-windows-cmake: extends: - .build-job-windows-with-check-for-warnings - #- .rules-basis + - .rules-basis script: - *print-common-info-windows - cmake -G "Visual Studio 15 2017" . -Bbuild -- GitLab From 099e1d3e3bce2c5940e32dd596716b72ba730eda Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Wed, 8 Mar 2023 11:10:29 +0200 Subject: [PATCH 5/7] Add msbuild job --- .gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a54c09297..2fc79fcc20 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -290,6 +290,15 @@ build-codec-windows-cmake: - cmake --build build -j16 | Out-File -FilePath $BUILD_OUTPUT - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'", "exit $LASTEXITCODE") | Invoke-Expression +build-codec-windows-msbuild: + extends: + - .build-job-windows-with-check-for-warnings + - .rules-basis + script: + - *print-common-info-windows + - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee $BUILD_OUTPUT + - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'", "exit $LASTEXITCODE") | Invoke-Expression + # --------------------------------------------------------------- # Test jobs for merge requests # --------------------------------------------------------------- -- GitLab From bdaf96c7884dfb172b21fc03db89d17d9f087824 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Fri, 10 Mar 2023 15:25:57 +0200 Subject: [PATCH 6/7] Force utf8 encoding for the windows build output files --- .gitlab-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2fc79fcc20..b946d39a72 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -286,8 +286,10 @@ build-codec-windows-cmake: - .rules-basis script: - *print-common-info-windows + - $winoutdata = $null - cmake -G "Visual Studio 15 2017" . -Bbuild - - cmake --build build -j16 | Out-File -FilePath $BUILD_OUTPUT + - cmake --build build -j16 | tee -variable winoutdata + - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'", "exit $LASTEXITCODE") | Invoke-Expression build-codec-windows-msbuild: @@ -296,7 +298,9 @@ build-codec-windows-msbuild: - .rules-basis script: - *print-common-info-windows - - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee $BUILD_OUTPUT + - $winoutdata = $null + - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee -variable winoutdata + - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'", "exit $LASTEXITCODE") | Invoke-Expression # --------------------------------------------------------------- -- GitLab From 9aeb16ac0545fd7ed30d84fa5775aea4244a9571 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Wed, 22 Mar 2023 16:00:16 +0100 Subject: [PATCH 7/7] exit with correct exit code for windows build jobs also replace 'build -j16' with 'build -j' --- .gitlab-ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b946d39a72..082cf40cab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -288,9 +288,10 @@ build-codec-windows-cmake: - *print-common-info-windows - $winoutdata = $null - cmake -G "Visual Studio 15 2017" . -Bbuild - - cmake --build build -j16 | tee -variable winoutdata + - cmake --build build -j | tee -variable winoutdata - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'", "exit $LASTEXITCODE") | Invoke-Expression + - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression + - ("exit $LASTEXITCODE") | Invoke-Expression build-codec-windows-msbuild: extends: @@ -301,7 +302,8 @@ build-codec-windows-msbuild: - $winoutdata = $null - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee -variable winoutdata - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'", "exit $LASTEXITCODE") | Invoke-Expression + - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression + - ("exit $LASTEXITCODE") | Invoke-Expression # --------------------------------------------------------------- # Test jobs for merge requests -- GitLab