From 247c4555cca7ca900ba1afc7aee76f7a7347670d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Kardos?= Date: Fri, 15 Mar 2024 23:29:31 +0100 Subject: [PATCH] ci --- .github/workflows/build_and_test_no_xsimd.yml | 82 +++++++++++++++++++ .github/workflows/sonarqube.yml | 6 +- 2 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build_and_test_no_xsimd.yml diff --git a/.github/workflows/build_and_test_no_xsimd.yml b/.github/workflows/build_and_test_no_xsimd.yml new file mode 100644 index 0000000..6a49aed --- /dev/null +++ b/.github/workflows/build_and_test_no_xsimd.yml @@ -0,0 +1,82 @@ +name: Build & test w/o XSimd + +on: + push: + branches: + - master + tags: + - v**.** + pull_request: + branches: + - master + +jobs: + build-test: + strategy: + fail-fast: false + matrix: + build_profile: [clang20d, clang20r] + include: + - build_profile: clang20d + conan_preset: clang-20-debug + os: ubuntu-latest + - build_profile: clang20r + conan_preset: clang-20-release + os: ubuntu-latest + + name: ${{ matrix.build_profile }} + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@v4 + - uses: seanmiddleditch/gha-setup-vsdevenv@master + + - run: pip install conan + + - name: Install native compilers + if: ${{ matrix.os == 'ubuntu-latest' }} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update + + sudo apt install gcc-13 g++-13 + sudo update-alternatives --remove-all gcc || true + sudo update-alternatives --remove-all g++ || true + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10 --slave /usr/bin/g++ g++ /usr/bin/g++-13 + + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 17 clang + + sudo update-alternatives --remove-all clang || true + sudo update-alternatives --remove-all clang++ || true + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 10 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-17 + + - name: Cache conan packages + id: cache-conan + uses: actions/cache@v3 + with: + path: ~/.conan2/p + key: conan-cache-packages-${{ matrix.build_profile }} + + - name: Create Build Environment + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + shell: bash + env: + PR: "${{github.workspace}}/.github/build_profiles/${{matrix.build_profile}}" + run: | + cmake -E make_directory "${{github.workspace}}/build" + conan install "${{github.workspace}}" --build=missing -pr $PR -pr:b $PR + conan cache clean + cmake -S "${{github.workspace}}" --preset conan-${{ matrix.conan_preset }} -DMATHTER_USE_XSIMD:BOOL=OFF + + - name: Build + run: | + cmake --build --preset conan-${{ matrix.conan_preset }} + + - name: Test + run: ${{github.workspace}}/build/${{ matrix.conan_preset }}/bin/UnitTest diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index a75671b..be07df5 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -40,7 +40,7 @@ jobs: wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 17 clang + sudo ./llvm.sh 17 clang llvm sudo update-alternatives --remove-all clang || true sudo update-alternatives --remove-all clang++ || true @@ -75,8 +75,8 @@ jobs: shell: bash run: | ./UnitTest --reporter junit --out ${{github.workspace}}/tests.xml - llvm-profdata merge -sparse default.profraw -o coverage.profdata - llvm-cov show ./test -instr-profile=coverage.profdata > ${{github.workspace}}/coverage.txt + llvm-profdata-17 merge -sparse default.profraw -o coverage.profdata + llvm-cov-17 show ./test -instr-profile=coverage.profdata > ${{github.workspace}}/coverage.txt - name: Run sonar-scanner env: