Using conan libpng only on Windows and OSX #236
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: Code coverage | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
codecov: | |
name: Code coverage | |
runs-on: ubuntu-24.04 | |
env: | |
BUILD_TYPE: RelWithDebInfo | |
# CODECOV_TOKEN: 9c75edd2-e08d-48ce-a919-5ee804875918 Not needed for public repository | |
PROJ_LIB: ${{github.workspace}}/bin/share/proj | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Cache Conan libs | |
id: cache-conan | |
uses: pat-s/[email protected] | |
with: | |
path: /home/runner/.conan | |
key: conan-codecov | |
- name: Install Conan | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel conan==1.* | |
# gitlab support (wxwidgets, mysql, gdal) | |
conan remote add gitlab https://gitlab.com/api/v4/packages/conan --force | |
# create default profile with libstdc++11 | |
conan profile new default --detect --force | |
conan profile update settings.compiler.libcxx=libstdc++11 default | |
conan profile update conf.tools.system.package_manager:mode=install default | |
conan profile update conf.tools.system.package_manager:sudo=True default | |
- name: Install system libs | |
run: | | |
sudo apt-get update | |
# lcov | |
sudo apt-get install lcov | |
# GTK 3.0 libraries & MySQL dependencies | |
sudo apt-get install libgtk-3-0 libgtk-3-dev | |
sudo apt-get install libgnutls30 libgnutls28-dev | |
sudo apt-get install libxcb-cursor0 libxcb-cursor-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev | |
sudo apt-get install libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev | |
sudo apt-get install libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev libxcb-util-dev libxcb-render0-dev | |
sudo apt-get install libxcb-dri2-0-dev libxcb-present-dev libxcb-glx0-dev libxcb-composite0-dev libxcb-xv0-dev | |
sudo apt-get install libxcb-xvmc0-dev libxcb-xinput-dev libxcb-ewmh-dev libxcb-xf86dri0-dev libxcb-xrm-dev | |
sudo apt-get install libxcb-record0-dev libxcb-xtest0-dev libxcb-res0-dev | |
sudo apt-get install libx11-xcb-dev libx11-dev libfontenc-dev libxaw7-dev libxmu-dev libxmuu-dev libxpm-dev | |
sudo apt-get install libxres-dev libxss-dev libxv-dev libxvmc-dev libxxf86vm-dev libxt-dev libxtst-dev | |
sudo apt-get install libncurses5-dev libssl-dev libice-dev | |
sudo apt-get install libsm-dev libxau-dev libxcomposite-dev libxcursor-dev libxdamage-dev | |
sudo apt-get install libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev | |
sudo apt-get install libxkbfile-dev libxrandr-dev libxrender-dev | |
sudo apt-get install xtrans-dev xkb-data uuid-dev libwebkit2gtk-4.1-dev | |
- name: Install libraries | |
run: | | |
mkdir ${{github.workspace}}/bin | |
cd ${{github.workspace}}/bin | |
conan install .. -o code_coverage=True --build=gtk --build=missing | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/bin | |
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_CODECOV=1 -DUSE_UNITTEST=1 | |
- name: Build and run code coverage | |
working-directory: ${{github.workspace}}/bin | |
run: cmake --build . --config ${{env.BUILD_TYPE}} --target code-coverage | |
- name: Preparing coverage data | |
working-directory: ${{github.workspace}}/bin | |
run: lcov --directory . --capture --output-file coverage.info | |
- name: Display code coverage report | |
working-directory: ${{github.workspace}}/bin | |
run: lcov --list coverage.info | |
- uses: codecov/codecov-action@v4 | |
with: | |
files: ${{github.workspace}}/bin/coverage.info | |
fail_ci_if_error: true | |
verbose: true |