linux-build-and-validation #65
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: linux-build-and-validation | |
on: | |
push: | |
branches: [ 'main' ] | |
pull_request: | |
branches: [ '**' ] | |
schedule: | |
- cron: '0 3 * * SUN' | |
workflow_dispatch: | |
env: | |
BUILD_DIR: ${{ github.workspace }}/build | |
TEST_DIR: ${{ github.workspace }}/build/tests | |
jobs: | |
build-validation: | |
runs-on: [ 'ubuntu-22.04' ] | |
steps: | |
- uses: actions/checkout@v4.1.4 | |
- name: python3-setting-up | |
run: | | |
sudo apt update && \ | |
sudo apt install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:deadsnakes/ppa && \ | |
sudo apt update && \ | |
sudo apt install python3.13 python3.13-venv -y | |
- name: python3-venv | |
run: | | |
python3.13 -m venv venv && \ | |
source venv/bin/activate | |
- name: CMake-package-update | |
run: | | |
sudo apt purge --auto-remove cmake && \ | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \ | |
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' && \ | |
sudo apt update && \ | |
sudo apt install cmake | |
- name: CMake-configuration-and-project-building | |
run: | | |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} && \ | |
cmake --build ${{ env.BUILD_DIR }} | |
- name: unit-tests-execution | |
working-directory: ${{ env.TEST_DIR }} | |
run: | | |
python run_unit_tests.py | |
sanitizers: | |
needs: [ 'build-validation' ] | |
runs-on: [ 'ubuntu-22.04' ] | |
steps: | |
- uses: actions/checkout@v4.1.4 | |
- name: python3-setting-up | |
run: | | |
sudo apt update && \ | |
sudo apt install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:deadsnakes/ppa && \ | |
sudo apt update && \ | |
sudo apt install python3.13 python3.13-venv -y | |
- name: python3-venv | |
run: | | |
python3.13 -m venv venv && \ | |
source venv/bin/activate | |
- name: CMake-package-update | |
run: | | |
sudo apt purge --auto-remove cmake && \ | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \ | |
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' && \ | |
sudo apt update && \ | |
sudo apt install cmake | |
- name: asan-execution | |
run: | | |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} -DASan=ON && \ | |
cmake --build ${{ env.BUILD_DIR }} && \ | |
python ${{ env.TEST_DIR }}/run_unit_tests.py && \ | |
rm -rf ${{ env.BUILD_DIR }} | |
- name: ubsan-execution | |
run: | | |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} -DUBSan=ON && \ | |
cmake --build ${{ env.BUILD_DIR }} && \ | |
python ${{ env.TEST_DIR }}/run_unit_tests.py && \ | |
rm -rf ${{ env.BUILD_DIR }} | |
- name: lsan-execution | |
run: | | |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} -DLSan=ON && \ | |
cmake --build ${{ env.BUILD_DIR }} && \ | |
python ${{ env.TEST_DIR }}/run_unit_tests.py && \ | |
rm -rf ${{ env.BUILD_DIR }} | |
valgrind: | |
needs: [ 'build-validation' ] | |
runs-on: [ 'ubuntu-22.04' ] | |
steps: | |
- uses: actions/checkout@v4.1.4 | |
- name: python3-setting-up | |
run: | | |
sudo apt update && \ | |
sudo apt install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:deadsnakes/ppa && \ | |
sudo apt update && \ | |
sudo apt install python3.13 python3.13-venv -y | |
- name: python3-venv | |
run: | | |
python3.13 -m venv venv && \ | |
source venv/bin/activate | |
- name: CMake-package-update | |
run: | | |
sudo apt purge --auto-remove cmake && \ | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \ | |
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' && \ | |
sudo apt update && \ | |
sudo apt install cmake | |
- name: valgrind-setting-up | |
run: | | |
sudo apt update --fix-missing && sudo apt install valgrind | |
- name: project-building | |
run: | | |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} && \ | |
cmake --build ${{ env.BUILD_DIR }} | |
- name: valgrind-execution | |
working-directory: ${{ env.TEST_DIR }} | |
run: | | |
python run_valgrind.py | |
code-formatting: | |
needs: [ 'build-validation' ] | |
runs-on: [ 'ubuntu-22.04' ] | |
steps: | |
- uses: actions/checkout@v4.1.4 | |
- uses: de-vri-es/setup-git-credentials@v2.1.2 | |
with: | |
credentials: ${{ secrets.GITHUB_TOKEN }} | |
- name: python3-setting-up | |
run: | | |
sudo apt update && \ | |
sudo apt install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:deadsnakes/ppa && \ | |
sudo apt update && \ | |
sudo apt install python3.13 python3.13-venv -y | |
- name: python3-venv | |
run: | | |
python3.13 -m venv venv && \ | |
source venv/bin/activate | |
- name: clang-format-execution | |
run: | | |
python scripts/run_clang_code_format.py | |
- name: changes-commiting | |
run: | | |
git config --global user.name "${{ secrets.AGENT_NAME }}" && git config --global user.email "${{ secrets.EMAIL }}" && \ | |
python .github/workflows/scripts/commit_changes.py | |
code-coverage-generation: | |
needs: [ 'build-validation' ] | |
runs-on: [ 'ubuntu-22.04' ] | |
steps: | |
- uses: actions/checkout@v4.1.4 | |
- name: python3-setting-up | |
run: | | |
sudo apt update && \ | |
sudo apt install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:deadsnakes/ppa && \ | |
sudo apt update && \ | |
sudo apt install python3.13 python3.13-venv -y | |
- name: python3-venv | |
run: | | |
python3.13 -m venv venv && \ | |
source venv/bin/activate | |
- name: CMake-package-update | |
run: | | |
sudo apt purge --auto-remove cmake && \ | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \ | |
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' && \ | |
sudo apt update && \ | |
sudo apt install cmake | |
- name: project-building | |
run: | | |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} -DCOVERAGE=ON && \ | |
cmake --build ${{ env.BUILD_DIR }} | |
- name: code-coverage-generating | |
working-directory: ${{ env.BUILD_DIR }} | |
run: | | |
sudo apt install lcov && \ | |
python generate_code_coverage.py | |
- name: code-coverage-raport-preaparing-to-publish | |
uses: actions/upload-pages-artifact@v3.0.1 | |
with: | |
path: "${{ env.BUILD_DIR }}/code_coverage" | |
deploy-code-coverage-raport: | |
needs: [ 'code-coverage-generation' ] | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: [ 'ubuntu-22.04' ] | |
if: contains(github.ref, 'main') | |
steps: | |
- name: code-coverage-raport-publishing | |
id: deployment | |
uses: actions/deploy-pages@v4.0.5 |