Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI/CD: Add build GitHub Actions workflows #53

Merged
merged 77 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
91afa41
Add linux CI/CD workflow
patrickpa May 22, 2024
9fc1a04
Add testing parameter for trigering workflow on PR
patrickpa May 22, 2024
202cb9e
Fix typo on dev_essential
patrickpa May 22, 2024
b21a109
Add proper working directories to workflow
patrickpa May 22, 2024
f41b861
Add cmake to workflow
patrickpa May 22, 2024
bbd362c
Fix cmake script execution
patrickpa May 22, 2024
681883b
Add directly whoami to build
patrickpa May 22, 2024
3b0ef44
Remove cmake to test user path
patrickpa May 22, 2024
89dc4e9
Fix import on file on the fly
patrickpa May 22, 2024
70701af
Remove rm on temp
patrickpa May 22, 2024
6474d94
Remove google tests from dependencies install
patrickpa May 22, 2024
7975bc7
Remove working directory on build step
patrickpa May 22, 2024
3713f2d
Add initial windows workflow
patrickpa May 22, 2024
eddea37
Remove directory specification on windows flow
patrickpa May 22, 2024
843d419
Fix echo outputs on windows workflow
patrickpa May 22, 2024
8086a9a
Fix username string interpolation on power shell script
patrickpa May 22, 2024
f3b983f
Replace desktop path to running env path
patrickpa May 22, 2024
68ca1c4
Test build without visual studion and cmake
patrickpa May 22, 2024
b35cc98
Fix QT download link
patrickpa May 22, 2024
2605fde
Test with Qt silent installer
patrickpa May 22, 2024
4d567ae
Fix multiline command
patrickpa May 22, 2024
6b32828
Remove multiline command
patrickpa May 22, 2024
5ce3ee1
Update relative paths on build elements
patrickpa May 22, 2024
a911c06
Add vs installer
patrickpa May 22, 2024
388010b
Try adding actions for dependencies
patrickpa May 22, 2024
e28862c
Remove extra args from Qt install action
patrickpa May 22, 2024
5d645d3
Set to latest Qt installer
patrickpa May 22, 2024
c94007e
Set host to windows-2019
patrickpa May 22, 2024
28714fc
Fix framework pathing on installation
patrickpa May 22, 2024
deab6d0
Fix qc-framework path on build
patrickpa May 22, 2024
16cdb4e
Add missing working path variable to build step
patrickpa May 22, 2024
530cf6f
Fix Xerces C options on framework build
patrickpa May 22, 2024
9d829fc
Fix flag on cmake for framework build
patrickpa May 22, 2024
a925e72
Set Xerces variables on build time
patrickpa May 23, 2024
0cfefda
Update profile reload
patrickpa May 23, 2024
39f5d2c
Test setting path directly as env variable on build
patrickpa May 23, 2024
cd334c7
Try with Xerces debug
patrickpa May 23, 2024
1fe03b2
Add build with dll to path
patrickpa May 23, 2024
5b63d77
Add variables to GITHUB_PATH
patrickpa May 23, 2024
4d8657f
Add smaller version of github path addition
patrickpa May 23, 2024
3731fda
Test setting manually Xerces env
patrickpa May 23, 2024
2cccd61
Fix typos on build command
patrickpa May 23, 2024
07e8b78
Fix build path om cmake install
patrickpa May 23, 2024
b2b2f15
Add qt5 root env directly to build
patrickpa May 23, 2024
e2a8d81
Update build command with multiline approach
patrickpa May 23, 2024
5108523
Fix typo on build directory creation
patrickpa May 23, 2024
cb853f6
Set properly multiline build
patrickpa May 23, 2024
8c52316
Test version for folders content
patrickpa May 23, 2024
79627b2
Adjust cmake command for readability
patrickpa May 23, 2024
e30ae7f
Test proper source and build path
patrickpa May 23, 2024
3ae335c
Adjust Qt5 root dir
patrickpa May 23, 2024
684cbb6
Remove install to test
patrickpa May 23, 2024
790dc17
Test with different Qt5 dir and root
patrickpa May 23, 2024
8b9a6fb
Fix typo on Qt5 flag
patrickpa May 23, 2024
4dfee1a
Try removing Qt5 DIR from cmake
patrickpa May 23, 2024
ebf6a9f
Fix env usdage for Qt5 envs vars
patrickpa May 23, 2024
53e5048
Update Qt5 root to Qt5_ROOT_DIR
patrickpa May 23, 2024
b1dcaea
Test different Qt5 dir
patrickpa May 23, 2024
0fc88ee
Remove Qt5 root
patrickpa May 23, 2024
48747ab
Try Qt5 import with env prefix
patrickpa May 23, 2024
761d81a
Add temp Qt5 print for tests
patrickpa May 23, 2024
0bb478d
Add arch to Qt5 install step
patrickpa May 23, 2024
720a31f
Set proper version for Qt5
patrickpa May 23, 2024
5ea0207
Add complete workflow for windows to test
patrickpa May 23, 2024
313c64a
Move to release build
patrickpa May 23, 2024
59621a2
Adjust dev essentials build
patrickpa May 23, 2024
6883034
Signed-off-by: Patrick Abrahão <[email protected]>
patrickpa May 23, 2024
168a2fd
Remove dev essential from dependencies on workflows
patrickpa May 23, 2024
b439a16
Update linux workflow to test latest dev essential removal
patrickpa May 23, 2024
fbc29d8
Add print to cmake for debug
patrickpa May 23, 2024
bf992b3
Fix print command
patrickpa May 23, 2024
b90a191
Fix toString option
patrickpa May 23, 2024
e0ac2f0
Fix type on set dll
patrickpa May 23, 2024
314938b
Fix wrong auto variable on report gui
patrickpa May 23, 2024
03c69d8
Proper convert path to string
patrickpa May 23, 2024
42f15f6
Remove temp branch from actions
patrickpa May 24, 2024
ff07cf7
Remove build environment for deployment
patrickpa May 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/build-on-change-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build framework on Linux

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/**

# 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-linux:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Create dependencies build space
run: mkdir dependencies
shell: bash

- name: Install dependencies
working-directory: dependencies
run: |
echo Updating CMAKE...
wget https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-x86_64.sh
sudo apt remove cmake
sudo apt purge --auto-remove cmake
sudo bash cmake-3.29.3-linux-x86_64.sh --skip-license --exclude-subdir --prefix=/usr/local
echo Installing Qt...
sudo apt update
sudo apt install \
qtbase5-dev \
libqt5xmlpatterns5-dev \
libxerces-c-dev \
pkg-config
echo Dependencies installed.
shell: bash

- name: Build framework
# Currently this is building without the XSD file. If we want to expose
# the build artifact after, we might as well need to add the XSD file.
run: |
echo Building framework...
cmake -G "Unix Makefiles" -B./build -S . -DCMAKE_INSTALL_PREFIX="/home/$(whoami)/qc-build" \
-DENABLE_FUNCTIONAL_TESTS=OFF -DXERCES_ROOT="/usr" \
-DQt5_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5/" \
-DQt5XmlPatterns_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5XmlPatterns/"
cmake --build ./build --target install --config Release -j4
cmake --install ./build
echo Done.
shell: bash
85 changes: 85 additions & 0 deletions .github/workflows/build-on-change-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
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/**

# 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
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Install Qt
uses: jurplel/[email protected]
with:
version: 5.15.2
host: windows
target: desktop
arch: win64_msvc2019_64

- 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
Add-Content $env:GITHUB_PATH "$workingPath\bin\xerces-c_3_2D.dll"
Add-Content $env:GITHUB_PATH "$workingPath\Xerces-Out\include"
Add-Content $env:GITHUB_PATH "$workingPath\Xerces-Out\bin"
shell: pwsh

- name: Build framework
run: |
$workingPath = "D:\a"
Write-Output "Setting up QC-Framework..."
cd "$workingPath\qc-framework\qc-framework"
mkdir build
cmake -H"$workingPath\qc-framework\qc-framework" -S. -Bbuild `
-G "Visual Studio 16 2019" -A x64 -T v142 `
-DCMAKE_INSTALL_PREFIX="$workingPath\QC-Framework-Out" `
-DENABLE_FUNCTIONAL_TESTS=OFF `
-DQt5_ROOT="$env:Qt5_DIR\Qt5\" `
-DXercesC_ROOT="$workingPath\Xerces-Out"
cmake --build build --target ALL_BUILD --config Release
cmake --install build
# Final output
Write-Output "All installations and setups are complete!"
shell: pwsh
6 changes: 4 additions & 2 deletions src/report_modules/report_module_gui/src/report_format_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ XERCES_CPP_NAMESPACE_USE
int main(int argc, char *argv[])
{
#ifdef WIN32
auto workdir = fs::current_path();
SetDllDirectoryA(workdir.toString().c_str());
auto currentPath = std::filesystem::current_path();
auto currentPathW = currentPath.string();
// Set the DLL directory
SetDllDirectory(currentPathW.c_str());
#endif

std::string strToolpath = argv[0];
Expand Down
Loading