Skip to content

Commit

Permalink
Added windows runners to the github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Jun 24, 2024
1 parent ffb1e15 commit e7386fc
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 1 deletion.
101 changes: 101 additions & 0 deletions .github/workflows/actions_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,104 @@ jobs:
run: cmake --build . --config ${{matrix.type}} --target install
env:
VERBOSE: 1

build_msvc_2019:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
type: [Debug, Release, MinSizeRel]
arch: [Win32, x64]
cpp: [11, 14, 17]

steps:
- uses: actions/checkout@v4

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Install Boost
shell: cmd
run: |
choco install boost-msvc-14.2
- name: Prepare externals
shell: cmd
run: |
%GITHUB_WORKSPACE%\script\prepare_externals.bat
env:
BUILD_DIR: ${{runner.workspace}}/build
PLATFORM: ${{matrix.arch}}
EXTERNALS_DIR: ${{runner.workspace}}/externals
COMMON_INSTALL_DIR: ${{runner.workspace}}/build/install
COMMON_BUILD_TYPE: ${{matrix.type}}
COMMON_CXX_STANDARD: ${{matrix.cpp}}
COMMS_TAG: ${{env.COMMS_TAG}}
COMMSDSL_TAG: ${{env.COMMSDSL_TAG}}
COMMSDSL_PLATFORM: 'x64'

- name: Configure CMake
shell: cmd
working-directory: ${{runner.workspace}}/build
run: |
cmake %GITHUB_WORKSPACE% -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_INSTALL_PREFIX=install ^
-DCMAKE_PREFIX_PATH="${{runner.workspace}}/build/install" -DBoost_USE_STATIC_LIBS=ON ^
-DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DOPT_FORCE_EXTRA_BOOST_LIBS=ON
- name: Build Target
working-directory: ${{runner.workspace}}/build
shell: cmd
run: cmake --build . --config ${{matrix.type}} --target install
env:
VERBOSE: 1

build_msvc_2022:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
type: [Debug, Release, MinSizeRel]
arch: [x64]
cpp: [11, 14, 17, 20]

steps:
- uses: actions/checkout@v4

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Install Boost
if: matrix.arch == 'x64'
shell: cmd
run: |
choco install boost-msvc-14.3
- name: Prepare externals
shell: cmd
run: |
%GITHUB_WORKSPACE%\script\prepare_externals.bat
env:
BUILD_DIR: ${{runner.workspace}}/build
PLATFORM: ${{matrix.arch}}
EXTERNALS_DIR: ${{runner.workspace}}/externals
COMMON_INSTALL_DIR: ${{runner.workspace}}/build/install
COMMON_BUILD_TYPE: ${{matrix.type}}
COMMON_CXX_STANDARD: ${{matrix.cpp}}
COMMS_TAG: ${{env.COMMS_TAG}}
COMMSDSL_TAG: ${{env.COMMSDSL_TAG}}
COMMSDSL_PLATFORM: 'x64'

- name: Configure CMake
shell: cmd
working-directory: ${{runner.workspace}}/build
run: |
cmake %GITHUB_WORKSPACE% -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_INSTALL_PREFIX=install ^
-DCMAKE_PREFIX_PATH="${{runner.workspace}}/build/install" -DBoost_USE_STATIC_LIBS=ON ^
-DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DOPT_FORCE_EXTRA_BOOST_LIBS=ON
- name: Build Target
working-directory: ${{runner.workspace}}/build
shell: cmd
run: cmake --build . --config ${{matrix.type}} --target install
env:
VERBOSE: 1
6 changes: 5 additions & 1 deletion script/prepare_externals.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rem COMMS_REPO - (Optional) Repository of the COMMS library
rem COMMS_TAG - (Optional) Tag of the COMMS library
rem COMMSDSL_REPO - (Optional) Repository of the commsdsl code generators
rem COMMSDSL_TAG - (Optional) Tag of the commdsl
rem COMMSDSL_PLATFORM - (Optional) Tag of the commdsl
rem COMMON_INSTALL_DIR - (Optional) Common directory to perform installations
rem COMMON_BUILD_TYPE - (Optional) CMake build type
rem COMMON_CXX_STANDARD - (Optional) CMake C++ standard
Expand All @@ -30,6 +31,9 @@ if [%COMMSDSL_REPO%] == [] set COMMSDSL_REPO="https://github.com/commschamp/comm

if [%COMMSDSL_TAG%] == [] set COMMSDSL_TAG="master"

set COMMSDSL_PLATFORM_PARAM=%PLATFORM_PARAM%
if NOT [%COMMSDSL_PLATFORM%] == [] set COMMSDSL_PLATFORM_PARAM=-A %COMMSDSL_PLATFORM%

if [%COMMON_BUILD_TYPE%] == [] set COMMON_BUILD_TYPE=Debug

set COMMS_SRC_DIR=%EXTERNALS_DIR%/comms
Expand Down Expand Up @@ -86,7 +90,7 @@ if exist %COMMSDSL_SRC_DIR%/.git (
echo "Building commsdsl ..."
mkdir "%COMMSDSL_BUILD_DIR%"
cd %COMMSDSL_BUILD_DIR%
cmake -G %GENERATOR% %PLATFORM_PARAM% -S %COMMSDSL_SRC_DIR% -B %COMMSDSL_BUILD_DIR% ^
cmake -G %GENERATOR% %COMMSDSL_PLATFORM_PARAM% -S %COMMSDSL_SRC_DIR% -B %COMMSDSL_BUILD_DIR% ^
-DCMAKE_INSTALL_PREFIX=%COMMSDSL_INSTALL_DIR% -DCMAKE_BUILD_TYPE=%COMMON_BUILD_TYPE% ^
-DCOMMSDSL_INSTALL_LIBRARY=OFF
if %errorlevel% neq 0 exit /b %errorlevel%
Expand Down

0 comments on commit e7386fc

Please sign in to comment.