Skip to content

CI/CD: Add build GitHub Actions workflows #25

CI/CD: Add build GitHub Actions workflows

CI/CD: Add build GitHub Actions workflows #25

name: Build framework on Windows
on:
# execute on every PR made targeting the branches bellow
pull_request:
branches:
- master
- develop # can be removed on master merge
paths: # we only include paths critical for building to avoid unnecessary runs
- src/**
- include/**
- scripts/cmake/**
- .github/** # only for testing this PR
# execute on every push made targeting the branches bellow
push:
branches:
- master
- develop # can be removed on master merge
paths: # we only include paths critical for building to avoid unnecessary runs
- src/**
- include/**
- scripts/cmake/**
jobs:
build-windows:
runs-on: windows-2019
environment: Build
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/[email protected]
with:
version: 5.12.2
host: windows
target: desktop
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install dependencies
run: |
$workingPath = "D:\a"
Write-Output "Setting up Xerces-C++..."
$xercesZip = "$workingPath\xerces-c-3.2.5.zip"
Invoke-WebRequest -Uri "https://dlcdn.apache.org/xerces/c/3/sources/xerces-c-3.2.5.zip" -OutFile $xercesZip
Expand-Archive -Path $xercesZip -DestinationPath "$workingPath"
cd "$workingPath\xerces-c-3.2.5"
mkdir build
cd build
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$workingPath\Xerces-Out" ..
cmake --build . --config Debug
cmake --build . --config Debug --target install
Write-Output "Setting up dev_essential..."
mkdir "$workingPath\dev_essential"
git clone https://github.com/cariad-tech/dev_essential.git "$workingPath\dev_essential"
cd "$workingPath\dev_essential"
mkdir build
cd build
cmake -H"$workingPath\dev_essential" -B. -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$workingPath\dev_essential-Out" ..
cmake --build . --config Release
cmake --build . --config Release --target install
shell: pwsh
- name: Build framework
run: |
$workingPath = "D:\a"
$env:PATH = $env:PATH + ";$workingPath\Xerces-Out\bin"
$env:XERCES_ROOT = "$workingPath\Xerces-Out"
mkdir $workingPath\build
Write-Output "Setting up QC-Framework..."
cmake -H"$workingPath\qc-framework\qc-framework" -B"$workingPath\build" -G "Visual Studio 16 2019" -A x64 -T v142 -DCMAKE_INSTALL_PREFIX="$workingPath\QC-Framework-Out" -DENABLE_FUNCTIONAL_TESTS=OFF -Ddev_essential_ROOT="$workingPath\dev_essential-Out\lib\cmake\dev_essential" -DQt5_ROOT="C:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5" -DXERCES_ROOT="$workingPath\Xerces-Out" -DXercesC_DIR="$workingPath\Xerces-Out\cmake" -DCMAKE_EXE_LINKER_FLAGS="/FORCE:MULTIPLE"
cmake --build "$workingPath\build" --target install --config Release
cmake --install "$workingPath\build"
# Final output
Write-Output "All installations and setups are complete!"
shell: pwsh