Advanced eclipses #3935
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
# ------------------------------------------------------------------------------------------------ # | |
# This file is part of CosmoScout VR # | |
# ------------------------------------------------------------------------------------------------ # | |
# SPDX-FileCopyrightText: German Aerospace Center (DLR) <cosmoscout@dlr.de> | |
# SPDX-License-Identifier: MIT | |
name: Build | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- "**" | |
jobs: | |
clang_format: | |
name: Check Clang-Format | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Checkout Submodules | |
run: git submodule update --init plugins | |
- name: Download Clang-Format | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y clang-format-11 | |
- name: Run Clang-Format | |
run: ./tools/clang-format.sh | |
- name: Compare Results | |
run: | | |
DIFF=$(git diff) | |
if [ ! -z "$DIFF" ]; then echo $DIFF && exit 1; fi | |
reuse: | |
name: Check Compliance with REUSE Specification | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: REUSE Compliance Check | |
uses: fsfe/reuse-action@v4 | |
comment_percentage: | |
name: Check Comment Percentage | |
runs-on: ubuntu-20.04 | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Checkout Current Repository | |
uses: actions/checkout@v4 | |
with: | |
path: current | |
ref: ${{ github.ref }} | |
- name: Checkout Base Repository | |
uses: actions/checkout@v4 | |
with: | |
path: base | |
ref: ${{ github.base_ref }} | |
- name: Checkout Current Submodules | |
run: cd $GITHUB_WORKSPACE/current && git submodule update --init plugins | |
- name: Checkout Base Submodules | |
run: cd $GITHUB_WORKSPACE/base && git submodule update --init plugins | |
- name: Download Cloc | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y cloc | |
- name: Run Cloc | |
run: | | |
BASE="$(base/tools/cloc.sh --percentage-only)" | |
CURRENT="$(current/tools/cloc.sh --percentage-only)" | |
echo "Percentage of Comments in Base Repository: $BASE" | |
echo "Percentage of Comments after Merge: $CURRENT" | |
if (( $(echo "$BASE > $CURRENT" |bc -l) )) | |
then | |
awk -v a=$CURRENT -v b=$BASE 'BEGIN {printf "Percentage decreased! (%3.4f%)\n", (a-b)}' | |
exit 1 | |
else | |
awk -v a=$CURRENT -v b=$BASE 'BEGIN {printf "Percentage increased! (%3.4f%)\n", (a-b)}' | |
fi | |
build_linux_gcc: | |
name: Linux GCC 9.3.0 | |
runs-on: ubuntu-20.04 | |
if: > | |
github.event_name == 'pull_request' || | |
( contains(github.ref, 'main') && !contains(github.event.head_commit.message, '[no-ci]') ) || | |
contains(github.event.head_commit.message, '[run-ci]') | |
env: | |
COSMOSCOUT_USE_PCH: false | |
COSMOSCOUT_USE_UNITY_BUILD: false | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Checkout Submodules | |
run: git submodule update --init --recursive | |
- name: Cache Object Files | |
uses: hendrikmuhs/ccache-action@v1.2.5 | |
with: | |
key: gcc | |
- name: Download Dependencies | |
run: | | |
sudo apt-get update -q | |
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev libx11-dev | |
sudo apt-get install libxi-dev libgconf-2-4 libboost-all-dev lcov xvfb | |
- name: Build Externals | |
run: > | |
./make_externals.sh -G "Unix Makefiles" | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache | |
- name: Build CosmoScout VR | |
run: | | |
cmake --preset linux-make-release-config -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCOSMOSCOUT_COVERAGE_INFO=On | |
cmake --build --preset linux-make-release-build | |
- name: Run Tests | |
run: | | |
./install/linux-Release/bin/run_tests.sh | |
- name: Run Graphical Tests | |
run: | | |
./install/linux-Release/bin/run_graphical_tests.sh | |
- name: Upload Results of Failed Test | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: graphical-test-results-gcc | |
path: install/linux-Release/bin/test | |
- name: Calculate Test Coverage | |
run: | | |
./tools/lcov.sh | |
- name: Upload Coverage Info | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./build/linux-Release/coverage.info | |
build_linux_clang: | |
name: Linux Clang 11.0 | |
runs-on: ubuntu-20.04 | |
if: > | |
github.event_name == 'pull_request' || | |
( contains(github.ref, 'main') && !contains(github.event.head_commit.message, '[no-ci]') ) || | |
contains(github.event.head_commit.message, '[run-ci]') | |
env: | |
CC: clang-11 | |
CXX: clang++-11 | |
COSMOSCOUT_USE_PCH: false | |
COSMOSCOUT_USE_UNITY_BUILD: false | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Checkout Submodules | |
run: git submodule update --init --recursive | |
- name: Cache Object Files | |
uses: hendrikmuhs/ccache-action@v1.2.5 | |
with: | |
key: clang | |
- name: Download Dependencies | |
run: | | |
sudo apt-get update -q | |
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev libx11-dev | |
sudo apt-get install libxi-dev libgconf-2-4 libboost-all-dev | |
- name: Build Externals | |
run: > | |
./make_externals.sh -G "Unix Makefiles" | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache | |
- name: Build CosmoScout VR | |
run: | | |
cmake --preset linux-make-release-config -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache | |
cmake --build --preset linux-make-release-build | |
- name: Run Tests | |
run: | | |
./install/linux-Release/bin/run_tests.sh | |
- name: Run Graphical Tests | |
run: | | |
./install/linux-Release/bin/run_graphical_tests.sh | |
- name: Upload Results of Failed Test | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: graphical-test-results-clang | |
path: install/linux-Release/bin/test | |
build_windows: | |
name: Windows MSVC 19.25 | |
runs-on: windows-2019 | |
if: > | |
github.event_name == 'pull_request' || | |
( contains(github.ref, 'main') && !contains(github.event.head_commit.message, '[no-ci]') ) || | |
contains(github.event.head_commit.message, '[run-ci]') | |
env: | |
BOOST_ROOT_1_72_0: C:\hostedtoolcache\windows\Boost\1.72.0\x86_64 | |
COSMOSCOUT_USE_PCH: true | |
COSMOSCOUT_USE_UNITY_BUILD: true | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Checkout Submodules | |
run: git submodule update --init --recursive | |
- name: Cache Object Files | |
uses: hendrikmuhs/ccache-action@v1.2.5 | |
with: | |
key: msvc | |
- name: Setup CMD | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Download Dependencies | |
run: | | |
# From https://github.com/actions/virtual-environments/issues/2667 | |
$url = "https://github.com/actions/boost-versions/releases/download/1.72.0-20200608.4/boost-1.72.0-win32-msvc14.2-x86_64.tar.gz" | |
(New-Object System.Net.WebClient).DownloadFile($url, "$env:TEMP\boost.tar.gz") | |
7z.exe x "$env:TEMP\boost.tar.gz" -o"$env:TEMP\boostArchive" -y | Out-Null | |
7z.exe x "$env:TEMP\boostArchive" -o"$env:TEMP\boost" -y | Out-Null | |
Push-Location -Path "$env:TEMP\boost" | |
Invoke-Expression .\setup.ps1 | |
choco install ninja | |
- name: Build Externals | |
shell: cmd | |
run: > | |
make_externals.bat -GNinja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache | |
- name: Build CosmoScout VR | |
shell: cmd | |
run: | | |
cmake --preset windows-ninja-release-config -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DBOOST_ROOT=%BOOST_ROOT_1_72_0% | |
cmake --build --preset windows-ninja-release-build | |
- name: Run Tests | |
shell: cmd | |
run: | | |
SET PATH=%BOOST_ROOT_1_72_0%\\lib;%PATH% | |
install\\windows-Release\\bin\\run_tests.bat |