-
Notifications
You must be signed in to change notification settings - Fork 8
107 lines (92 loc) · 3.21 KB
/
build-on-change-linux.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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/**
- tests/**
# 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
env:
TEST_ENABLED: ${{ github.event_name == 'pull_request' && 'ON' || 'OFF' }}
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: Install gtest
working-directory: dependencies
if: github.event_name == 'pull_request'
env:
CXX: g++-10
run: |
echo Installing gtest...
git clone https://github.com/google/googletest.git -b release-1.10.0
cd googletest
mkdir build
cd build
cmake ..
make
sudo make install
echo Gtest 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=$TEST_ENABLED -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
- name: Test
if: github.event_name == 'pull_request'
run: |
echo Starting tests...
ctest --test-dir build -C Release
echo All tests done.
shell: bash
- name: Archive test results
if: github.event_name == 'pull_request' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: test-report
path: ${{ github.workspace }}/build/Testing/Temporary/LastTest.log