Merge pull request #162 from Fields2Cover/modify-order-ortools-find-p… #1
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: Update docs | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
if: github.repository_owner == 'Fields2Cover' | |
name: "Building docs" | |
runs-on: ubuntu-latest | |
container: "osgeo/gdal:ubuntu-full-3.6.3" | |
strategy: | |
fail-fast: false | |
matrix: | |
gcc: [12] | |
gdal: ["3.6.3"] | |
swig: ["v4.2.1"] | |
shared: ["ON"] | |
generators: ["Unix Makefiles"] | |
build_type: ["Debug"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Print env | |
run: | | |
echo github.event.action: ${{ github.event.action }} | |
echo github.event_name: ${{ github.event_name }} | |
- uses: lukka/get-cmake@latest | |
- name: Ubuntu system dependencies | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update --allow-insecure-repositories -y | |
apt-get install -y --allow-unauthenticated --no-install-recommends ca-certificates | |
apt-get install -y --allow-unauthenticated --no-install-recommends build-essential doxygen graphviz g++-${{ matrix.gcc }} gcc-${{ matrix.gcc }} gnuplot git lcov libboost-dev libeigen3-dev libgeos-dev libgtest-dev libpython3-dev libtbb-dev python3 python3-matplotlib python3-pip python3-pytest python3-tk swig libtinyxml2-dev libtinyxml2-9 nlohmann-json3-dev | |
python3 -m pip install gcovr setuptools | |
python3 -m pip install -r ./docs/requirements.txt | |
# Solve issue with matplotlib | |
python3 -c "import matplotlib" | |
echo "backend: Agg" > ~/.config/matplotlib/matplotlibrc | |
# Install Gtest | |
cd /usr/src/gtest | |
cmake CMakeLists.txt | |
make | |
cp *.a /usr/lib/ 2>\dev\null || : | |
cp lib/*.a /usr/lib/ 2>\dev\null || : | |
ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a | |
ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a | |
- name: Configure GDAL | |
shell: bash | |
run: | | |
mkdir -p /usr/include/new_gdal | |
cp -r /usr/include/gdal* /usr/include/new_gdal/ | |
cp /usr/include/ogr* /usr/include/new_gdal/ | |
cp /usr/include/cpl* /usr/include/new_gdal/ | |
mv /usr/include/new_gdal/ /usr/include/gdal/ | |
- name: Configure Or-tools | |
shell: bash | |
run: | | |
wget https://github.com/google/or-tools/releases/download/v9.9/or-tools_amd64_ubuntu-22.04_cpp_v9.9.3963.tar.gz -q -O /tmp/ortools.tar.gz | |
mkdir -p /tmp/ortools | |
tar -zxf /tmp/ortools.tar.gz -C /tmp/ortools --strip-components=1 | |
cp -r /tmp/ortools/bin/. /usr/bin | |
cp -r /tmp/ortools/include/. /usr/include | |
cp -r /tmp/ortools/lib/. /usr/lib | |
cp -r /tmp/ortools/lib/cmake/. /usr/share | |
cp -r /tmp/ortools/share/. /usr/share/ortools | |
- name: Configure | |
working-directory: ${{github.workspace}} | |
shell: bash | |
run: | | |
mkdir build | |
mkdir instdir | |
cmake \ | |
-S . \ | |
-B build \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-G "${{matrix.generators}}" \ | |
-D CMAKE_C_COMPILER=gcc-${{ matrix.gcc }} \ | |
-D CMAKE_CXX_COMPILER=g++-${{ matrix.gcc }} \ | |
-DCMAKE_INSTALL_PREFIX:PATH=instdir \ | |
-DBUILD_PYTHON=OFF \ | |
-DALLOW_PARALLELIZATION=ON \ | |
-DBUILD_TUTORIALS=OFF \ | |
-DBUILD_TESTS=ON \ | |
-DBUILD_DOC=ON | |
- name: Build | |
working-directory: ${{github.workspace}}/build | |
run: | | |
make -j2 | |
rm -rf docs/docs/sphinx/.doctrees docs/docs/sphinx/.buildinfo | |
touch docs/docs/sphinx/.nojekyll | |
- name: Deploy new docs | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }} | |
with: | |
source-directory: build/docs/docs/sphinx/ | |
destination-github-username: Fields2Cover | |
destination-repository-name: fields2cover.github.io | |
target-branch: master | |
user-email: "[email protected]" | |
- name: Test C++ | |
working-directory: ${{github.workspace}}/build | |
run: make check | |
- name: Create code coverage report | |
working-directory: ${{github.workspace}} | |
if: ${{ matrix.build_type == 'Debug'}} | |
run: gcovr --gcov-executable gcov-12 -p -r . --exclude-function-lines --exclude-unreachable-branches --exclude-throw-branches -f src -f include --cobertura coverage.xml | |
- name: Upload coverage reports to Coveralls | |
if: ${{ matrix.build_type == 'Debug'}} | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
file: coverage.xml | |