From ee3bfca54e1c30a5671d185e81c5f9e00b0857e2 Mon Sep 17 00:00:00 2001 From: bpkroth Date: Thu, 20 Aug 2020 11:11:06 -0500 Subject: [PATCH 1/6] Create initial github actions pipeline for building on windows --- .github/workflows/main.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..d2f0eb8951 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the main branch +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + windows-msbuild-debug: + name: Run debug msbuild on Windows + runs-on: windows-2019 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run debug msbuild + shell: cmd + run: | + set Configuration=Debug + scripts\build.windows.cmd + + windows-msbuild-release: + name: Run release msbuild on Windows + runs-on: windows-2019 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run release msbuild + shell: cmd + run: | + set Configuration=Release + scripts\build.windows.cmd From 5d3c5654200ad5c5215056f819173e164fc87abd Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 20 Aug 2020 11:13:37 -0500 Subject: [PATCH 2/6] add the build script referenced in the github actions ci pipeline --- scripts/build.windows.cmd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/build.windows.cmd diff --git a/scripts/build.windows.cmd b/scripts/build.windows.cmd new file mode 100644 index 0000000000..6fbcdade96 --- /dev/null +++ b/scripts/build.windows.cmd @@ -0,0 +1,17 @@ +@echo off +rem Build script for Windows. Used in Github Actions for continuous integration checks. + +rem Move to the root of the repo. +pushd "%~dp0\.." + +rem Setup the build environment. +call .\scripts\init.windows.cmd + +rem Make style check failures fail the build. +set UncrustifyAutoFix=false + +rem Build all .vcxproj and .csproj files listed in the various dirs.proj files. +rem Note: This also includes running unit tests. +msbuild /m /r dirs.proj + +exit /B %ERRORLEVEL% From fa7e6281464000914aa6de9178b9dbf836a653eb Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 20 Aug 2020 11:29:57 -0500 Subject: [PATCH 3/6] comments --- scripts/build.windows.cmd | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build.windows.cmd b/scripts/build.windows.cmd index 6fbcdade96..501dbe8f43 100644 --- a/scripts/build.windows.cmd +++ b/scripts/build.windows.cmd @@ -1,5 +1,6 @@ @echo off rem Build script for Windows. Used in Github Actions for continuous integration checks. +rem Note: "set Configuration={Release or Debug}" to switch the build type. rem Move to the root of the repo. pushd "%~dp0\.." From 3fee0799f0ab43503ee2db7287457081e8f7b288 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 20 Aug 2020 11:33:33 -0500 Subject: [PATCH 4/6] commit something that should fail the uncrustify check just to make sure that the pipelines fail --- source/Mlos.Core/Utils.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/Mlos.Core/Utils.h b/source/Mlos.Core/Utils.h index 52a9f0554d..a23817c4d0 100644 --- a/source/Mlos.Core/Utils.h +++ b/source/Mlos.Core/Utils.h @@ -26,8 +26,7 @@ namespace Core // // NOTES: // -inline constexpr uint32_t lower_uint32(const uint64_t value) -{ +inline constexpr uint32_t lower_uint32(const uint64_t value) { return static_cast(value); } From 1424eae00f8291242ee28fd11423b25a73ce4c5b Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 20 Aug 2020 11:40:26 -0500 Subject: [PATCH 5/6] Revert "commit something that should fail the uncrustify check just to make sure that the pipelines fail" This reverts commit 3fee0799f0ab43503ee2db7287457081e8f7b288. Manually verified that this does indeed fail the build pipeline. --- source/Mlos.Core/Utils.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Mlos.Core/Utils.h b/source/Mlos.Core/Utils.h index a23817c4d0..52a9f0554d 100644 --- a/source/Mlos.Core/Utils.h +++ b/source/Mlos.Core/Utils.h @@ -26,7 +26,8 @@ namespace Core // // NOTES: // -inline constexpr uint32_t lower_uint32(const uint64_t value) { +inline constexpr uint32_t lower_uint32(const uint64_t value) +{ return static_cast(value); } From 927a36d0a8a783a39efc679247f8ae374c037b6e Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 20 Aug 2020 11:57:05 -0500 Subject: [PATCH 6/6] tell editors to use 2 spaces instead of 4 by default for yaml files --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index 91c7769e9c..4ba6c5a6f8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -37,3 +37,6 @@ end_of_line = lf [{CMakeLists.txt,*.cmake}] end_of_line = lf + +[*.yml] +indent_size = 2