action #320
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: Tests for Library | |
on: [push, pull_request] | |
env: | |
COMPILER: c++ | |
jobs: | |
Tests-Viewshed-library: | |
runs-on: ubuntu-latest | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
QT_QPA_PLATFORM: "offscreen" | |
XDG_RUNTIME_DIR: "/tmp" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Update and Upgrade | |
run: | | |
sudo apt update | |
sudo apt install ninja-build doxygen libgtest-dev libgmock-dev clang | |
- name: Install GDAL | |
run: | | |
sudo add-apt-repository ppa:ubuntugis/ppa | |
sudo apt update | |
sudo apt-get -y install gdal-bin libgdal-dev | |
- uses: robinraju/release-downloader@v1.8 | |
with: | |
repository: "JanCaha/cpp-simplerasters" | |
latest: true | |
fileName: "*.deb" | |
tarBall: false | |
zipBall: false | |
- name: Install and remove artifact | |
run: | | |
sudo apt install ./simplerasters*.deb | |
rm simplerasters* | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Configure | |
run: | | |
mkdir build | |
cmake \ | |
-S. \ | |
-Bbuild \ | |
-G Ninja \ | |
-DCMAKE_CXX_COMPILER=${COMPILER} \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DPACK_DEB:bool=off \ | |
-DBUILD_DOCUMENTATION:bool=off \ | |
-DBUILD_TESTS:bool=on \ | |
-DCELL_EVENT_DATA_FLOAT:bool=on \ | |
-DOUTPUT_RASTER_DATA_FLOAT:bool=on \ | |
-DNEEDS_QT:bool=off | |
- name: Build | |
run: | | |
cmake --build build --config Release --target library_viewshed | |
- name: Run Tests | |
id: unittests | |
run: | | |
cmake --build build --config Release --target build_tests | |
cmake --build build --config Release --target run_tests | |
- name: Clean Build | |
run: | | |
rm -rf build | |
mkdir build | |
- name: Run Tests with double | |
id: unittestsdouble | |
run: | | |
cmake \ | |
-S. \ | |
-Bbuild \ | |
-G Ninja \ | |
-DCMAKE_CXX_COMPILER=${COMPILER} \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DPACK_DEB:bool=off \ | |
-DBUILD_DOCUMENTATION:bool=off \ | |
-DBUILD_TESTS:bool=on \ | |
-DCELL_EVENT_DATA_FLOAT:bool=off \ | |
-DOUTPUT_RASTER_DATA_FLOAT:bool=off \ | |
-DNEEDS_QT:bool=off | |
cmake --build build --config Release --target build_tests | |
cmake --build build --config Release --target run_tests | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '5.15.2' | |
host: 'linux' | |
- name: Clean Build | |
run: | | |
rm -rf build | |
mkdir build | |
- name: Configure | |
run: | | |
cmake \ | |
-S. \ | |
-Bbuild \ | |
-G Ninja \ | |
-DCMAKE_CXX_COMPILER=${COMPILER} \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DPACK_DEB:bool=off \ | |
-DBUILD_DOCUMENTATION:bool=off \ | |
-DBUILD_TESTS:bool=on \ | |
-DCELL_EVENT_DATA_FLOAT:bool=on \ | |
-DOUTPUT_RASTER_DATA_FLOAT:bool=on \ | |
-DNEEDS_QT:bool=on \ | |
-D CMAKE_INSTALL_PREFIX=/usr | |
- name: Run Tests even with Qt | |
id: unittestsqt | |
run: | | |
cmake --build build --config Release --target build_tests | |
cd build | |
ctest -VV | |
- name: Test Install | |
run: | | |
cmake --build build --config Release --target all | |
sudo cmake --build build --config Release --target install | |