-
Notifications
You must be signed in to change notification settings - Fork 8
160 lines (137 loc) · 6.47 KB
/
build-on-change-linux-bare.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Build framework on Linux Bare
on:
# execute on every PR made targeting the branches bellow
pull_request:
branches:
- main
paths: # we only include paths critical for building to avoid unnecessary runs
- src/**
- include/**
- scripts/cmake/**
- test/**
- .github/workflows/**
- doc/**
- qc_framework/**
- docker/**
# execute on every push made targeting the branches bellow
push:
branches:
- main
paths: # we only include paths critical for building to avoid unnecessary runs
- src/**
- include/**
- scripts/cmake/**
- test/**
- .github/workflows/**
- doc/**
- qc_framework/**
- docker/**
workflow_dispatch: # Allows manual triggering of the workflow
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 "Installing Dependencies..."
sudo apt update
sudo apt install \
g++ \
g++-10 \
make \
build-essential \
cmake \
libgtest-dev \
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=$TEST_ENABLED \
-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: Prepare build artifacts
run: |
sudo chmod -R +x ./build/src/
shell: bash
- name: Archive release binaries
shell: bash
run: mkdir artifacts && cp ./build/src/result_pooling/ResultPooling ./build/src/report_modules/report_module_text/TextReport ./build/src/report_modules/report_module_github_ci/GithubCIReport ./build/src/report_modules/report_module_gui/ReportGUI artifacts/
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: qc-framework-executables-linux_x64
path: artifacts
- name: Unit test execution
run: |
echo Starting tests...
ctest --test-dir build -C Release
echo All tests done.
shell: bash
- name: Archive test results
uses: actions/upload-artifact@v4
with:
name: unit-test-report-ubuntu
path: ${{ github.workspace }}/build/Testing/Temporary/LastTest.log
- name: Framework test execution
run: |
mv build out_build
cp -r /home/$(whoami)/qc-build/bin bin
cp out_build/examples/checker_bundle_example/DemoCheckerBundle bin/
cd qc_framework
curl -sSL https://install.python-poetry.org | python3 -
poetry install --with dev
poetry run pytest -rA > runtime_test.log
- name: Archive Framework test results
uses: actions/upload-artifact@v4
with:
name: framework-test-report-ubuntu
path: ${{ github.workspace }}/qc_framework/runtime_test.log
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Execute checker bundles
run: |
export ASAM_QC_FRAMEWORK_MANIFEST_DIR=${{ github.workspace }}/.github/workflows/linux-manifest
export ASAM_QC_FRAMEWORK_INSTALLATION_DIR=/home/$(whoami)/qc-build/bin
pip install -e ${{ github.workspace }}/qc_framework
mkdir "/home/$(whoami)/odr_out"
pip install asam-qc-opendrive@git+https://github.com/asam-ev/qc-opendrive@main
qc_runtime --config="${{ github.workspace }}/.github/workflows/linux-files/odr_config.xml" --manifest="${{ github.workspace }}/.github/workflows/linux-manifest/framework.json" --working_dir="/home/$(whoami)/odr_out"
if [ ! -f "/home/$(whoami)/odr_out/xodr_bundle_report.xqar" ]; then echo "Error: Odr output does not exist."; exit 1; fi
if [ ! -f "/home/$(whoami)/odr_out/Result.xqar" ]; then echo "Error: Odr output does not exist."; exit 1; fi
if [ ! -f "/home/$(whoami)/odr_out/Report.txt" ]; then echo "Error: Odr output does not exist."; exit 1; fi
mkdir "/home/$(whoami)/osc_out"
pip install asam-qc-openscenarioxml@git+https://github.com/asam-ev/qc-openscenarioxml@main
qc_runtime --config="/home/$(whoami)/work/qc-framework/qc-framework/.github/workflows/linux-files/osc_config.xml" --manifest="/home/$(whoami)/work/qc-framework/qc-framework/.github/workflows/linux-manifest/framework.json" --working_dir="/home/$(whoami)/osc_out"
if [ ! -f "/home/$(whoami)/osc_out/xosc_bundle_report.xqar" ]; then echo "Error: Osc output does not exist."; exit 1; fi
if [ ! -f "/home/$(whoami)/osc_out/Result.xqar" ]; then echo "Error: Osc output does not exist."; exit 1; fi
if [ ! -f "/home/$(whoami)/osc_out/Report.txt" ]; then echo "Error: Osc output does not exist."; exit 1; fi
mkdir "/home/$(whoami)/otx_out"
pip install asam-qc-otx@git+https://github.com/asam-ev/qc-otx@main
qc_runtime --config="/home/$(whoami)/work/qc-framework/qc-framework/.github/workflows/linux-files/otx_config.xml" --manifest="/home/$(whoami)/work/qc-framework/qc-framework/.github/workflows/linux-manifest/framework.json" --working_dir="/home/$(whoami)/otx_out"
if [ ! -f "/home/$(whoami)/otx_out/otx_bundle_report.xqar" ]; then echo "Error: Otx output does not exist."; exit 1; fi
if [ ! -f "/home/$(whoami)/otx_out/Result.xqar" ]; then echo "Error: Otx output does not exist."; exit 1; fi
if [ ! -f "/home/$(whoami)/otx_out/Report.txt" ]; then echo "Error: Otx output does not exist."; exit 1; fi
shell: bash