Add copyright, license header and SPDX-License-Identifier #461
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |