Bump uraimo/run-on-arch-action from 2 to 3 #619
Workflow file for this run
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: "CPP Unit Tests" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: build-unit-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit-tests: | |
| name: "Build ${{ matrix.build_type }} with ${{ matrix.compiler }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build_type: | |
| - Debug | |
| - Release | |
| compiler: | |
| - gcc:9 | |
| - gcc:10 | |
| - gcc:11 | |
| - gcc:12 | |
| - gcc:13 | |
| - silkeh/clang:13 | |
| - silkeh/clang:14 | |
| - silkeh/clang:15 | |
| - silkeh/clang:16 | |
| - silkeh/clang:17 | |
| - silkeh/clang:18 | |
| container: | |
| image: ${{ matrix.compiler }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install build tools | |
| run: | | |
| apt-get update | |
| apt-get install -y git \ | |
| cmake make ninja-build sudo \ | |
| python3 python3-pip python3-venv \ | |
| libcurl4-gnutls-dev | |
| - name: "Run CMake" | |
| shell: bash | |
| run: | | |
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
| -DENABLE_COVERAGE=OFF \ | |
| -DBUILD_PYTHON_BINDINGS=OFF \ | |
| -DCAPIO_CL_BUILD_TESTS=ON \ | |
| -G Ninja \ | |
| -B ${{ github.workspace }}/build \ | |
| . | |
| cmake --build ${{ github.workspace }}/build -j $(nproc) | |
| sudo cmake --install ${{ github.workspace }}/build --prefix /usr/local | |
| - name: Run unit tests | |
| shell: bash | |
| run: CAPIO_CL_tests --gtest_break_on_failure --gtest_print_time=1 | |
| upload-to-codecov: | |
| name: "compute Codecov" | |
| needs: [ "unit-tests"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Install packages" | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y git \ | |
| cmake make ninja-build sudo \ | |
| python3 python3-pip python3-venv \ | |
| gcc g++ libcurl4-gnutls-dev | |
| - name: "Compile tests" | |
| run: | | |
| cmake -DCMAKE_BUILD_TYPE=Debug \ | |
| -DENABLE_COVERAGE=ON \ | |
| -DBUILD_PYTHON_BINDINGS=OFF \ | |
| -DCAPIO_CL_BUILD_TESTS=ON \ | |
| -G Ninja \ | |
| -B ../build \ | |
| -S ${GITHUB_WORKSPACE} | |
| cmake --build ../build -j $(nproc) | |
| sudo cmake --install ../build --prefix /usr/local | |
| - name: Run unit tests | |
| shell: bash | |
| run: CAPIO_CL_tests --gtest_break_on_failure --gtest_print_time=1 | |
| - name: "Generate coverage report" | |
| run: | | |
| pip install --upgrade gcovr | |
| gcovr \ | |
| --exclude-throw-branches \ | |
| --gcov-ignore-parse-errors=negative_hits.warn \ | |
| --exclude tests/ \ | |
| --xml coverage.xml \ | |
| ../build | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage.xml | |
| retention-days: 1 | |
| - name: "Download artifacts" | |
| uses: actions/download-artifact@v4 | |
| - name: "Upload coverage to Codecov" | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| build-documentation: | |
| name: "Build Doxygen documentation" | |
| runs-on: ubuntu-latest | |
| needs: upload-to-codecov | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Install packages" | |
| run: | | |
| sudo apt update | |
| sudo apt install make graphviz wget | |
| - name: "Install Doxygen 1.14.0" | |
| run: | | |
| wget https://www.doxygen.nl/files/doxygen-1.14.0.linux.bin.tar.gz | |
| tar -xzf doxygen-1.14.0.linux.bin.tar.gz | |
| sudo mv doxygen-1.14.0/bin/doxygen /usr/local/bin/doxygen | |
| doxygen --version | |
| - name: "Run Doxygen" | |
| working-directory: doxygen | |
| run: make | |
| codespell-check: | |
| name: "Check codespell conformance" | |
| needs: upload-to-codecov | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Run codespell" | |
| uses: codespell-project/actions-codespell@v2 | |
| format-check: | |
| name: "Check ${{ matrix.path }} clang-format conformance" | |
| needs: upload-to-codecov | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| path: | |
| - "src" | |
| - "capiocl" | |
| - "tests" | |
| - "bindings" | |
| - "capiocl.hpp" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Run clang-format style check" | |
| uses: DoozyX/clang-format-lint-action@v0.20 | |
| with: | |
| source: ${{matrix.path}} | |
| extensions: 'h,cpp,c' | |
| clangFormatVersion: 20 |