another missing package to build doc #244
This file contains hidden or 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-Linux | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'doc/**' | |
| - '**.md' | |
| - '**.rst' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install system prerequisites | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libgraphviz-dev \ | |
| libboost-all-dev \ | |
| pybind11-dev \ | |
| lcov \ | |
| gcovr \ | |
| doxygen \ | |
| python3-breathe \ | |
| python3-sphinx \ | |
| python3-sphinx-rtd-theme \ | |
| python3-defusedxml \ | |
| python3-recommonmark | |
| - name: Cache SimGrid | |
| uses: actions/cache@v4 | |
| id: cache-simgrid | |
| with: | |
| path: /opt/simgrid | |
| key: ${{ runner.os }}-simgrid-python-v2 | |
| - name: Install SimGrid | |
| if: steps.cache-simgrid.outputs.cache-hit != 'true' | |
| run: | | |
| git clone --depth 1 https://framagit.org/simgrid/simgrid.git | |
| cd simgrid | |
| cmake -B build -Denable_smpi=OFF -Denable_model-checking=OFF -Denable_smemory=OFF -Denable_python=ON -DCMAKE_INSTALL_PREFIX=/opt/simgrid | |
| cmake --build build -j$(nproc) | |
| sudo cmake --install build | |
| - name: Cache Google Test | |
| uses: actions/cache@v4 | |
| id: cache-gtest | |
| with: | |
| path: /opt/gtest | |
| key: ${{ runner.os }}-gtest-v1 | |
| - name: Install Google Test | |
| if: steps.cache-gtest.outputs.cache-hit != 'true' | |
| run: | | |
| wget -q https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz | |
| tar xf release-1.11.0.tar.gz | |
| cd googletest-release-1.11.0 | |
| cmake -B build -DCMAKE_INSTALL_PREFIX=/opt/gtest | |
| cmake --build build -j$(nproc) | |
| sudo cmake --install build | |
| - name: Build and test with coverage | |
| run: | | |
| SIMGRID_PYTHON_PATH=$(find /opt/simgrid/lib -type d -path "*/python*/site-packages" 2>/dev/null | head -1) | |
| if [ -z "$SIMGRID_PYTHON_PATH" ]; then | |
| SIMGRID_PYTHON_PATH=$(find /opt/simgrid/lib -type d -path "*/python*/dist-packages" 2>/dev/null | head -1) | |
| fi | |
| echo "Using SimGrid Python path: $SIMGRID_PYTHON_PATH" | |
| REPO_ROOT=$(pwd) | |
| export LD_LIBRARY_PATH=$REPO_ROOT/build/lib:/opt/simgrid/lib:/usr/local/lib | |
| export PYTHONPATH="$SIMGRID_PYTHON_PATH:$REPO_ROOT/build/lib" | |
| cmake -B build \ | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DCMAKE_PREFIX_PATH=/opt/simgrid:/opt/gtest | |
| cmake --build build -j$(nproc) | |
| cmake --build build --target unit_tests --target examples -j$(nproc) | |
| cd build | |
| ./unit_tests | |
| ./examples/open_seek_write | |
| ./examples/jbod | |
| cd test/python | |
| python3 ./unit_tests_python.py | |
| - name: Generate coverage report | |
| run: | | |
| cd build | |
| lcov --keep-going --ignore-errors mismatch --directory . --capture --output-file coverage.info | |
| lcov --ignore-errors mismatch --remove coverage.info '*/test/*' '*/examples/*' -o coverage.info | |
| gcovr --root .. -e '../test' -e '../examples' --sonarqube -o coverage.xml \ | |
| --exclude-throw-branches --gcov-ignore-parse-errors --exclude-unreachable-branches | |
| - name: Upload coverage to Codecov | |
| if: env.CODECOV_TOKEN != '' | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| run: | | |
| bash <(curl -s https://codecov.io/bash) -f build/coverage.info -t ${CODECOV_TOKEN} | |
| - name: Build and deploy documentation | |
| if: github.ref == 'refs/heads/main' && env.TOKEN_GITHUB != '' | |
| env: | |
| TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }} | |
| run: | | |
| cmake --build build --target doc | |
| mkdir -p $HOME/gh-pages-to-deploy | |
| cp -r build/docs/latest/* $HOME/gh-pages-to-deploy/ | |
| git config --global user.email "actions@github.com" | |
| git config --global user.name "GitHub Actions" | |
| git clone --quiet --branch=gh-pages https://${TOKEN_GITHUB}@github.com/simgrid/file-system-module.git gh-pages > /dev/null | |
| cd gh-pages | |
| cp -Rf $HOME/gh-pages-to-deploy/* . | |
| touch .nojekyll | |
| git add -f . | |
| git diff-index --quiet HEAD || git commit -m "GitHub build $GITHUB_RUN_NUMBER" | |
| git push -fq origin gh-pages > /dev/null | |
| echo "Done updating gh-pages!" |