From 5c6880e9ca7aa00dc6c759429d39acc07f0beee9 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 13 Mar 2024 13:15:46 +0100 Subject: [PATCH] [INFRA] Simplify CI a bit --- .github/workflows/ci_coverage.yml | 22 +++++----------------- .github/workflows/ci_linux.yml | 14 -------------- .github/workflows/ci_macos.yml | 14 -------------- .github/workflows/lint.yml | 3 --- 4 files changed, 5 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci_coverage.yml b/.github/workflows/ci_coverage.yml index c2aa21e..d9e14d8 100644 --- a/.github/workflows/ci_coverage.yml +++ b/.github/workflows/ci_coverage.yml @@ -11,10 +11,9 @@ on: concurrency: group: coverage-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: false + cancel-in-progress: ${{ github.event_name != 'push' }} env: - SHARG_NO_VERSION_CHECK: 1 TZ: Europe/Berlin defaults: @@ -34,16 +33,10 @@ jobs: compiler: "gcc-13" steps: - # How many commits do we need to fetch to also fetch the branch point? - - name: Get fetch depth - id: fetch_depth - run: echo "depth=$(( ${{ github.event.pull_request.commits }} + 2 ))" >> $GITHUB_OUTPUT - - name: Checkout uses: actions/checkout@v4 with: - fetch-depth: ${{ steps.fetch_depth.outputs.depth }} - submodules: false + fetch-depth: 0 - name: Setup toolchain uses: seqan/actions/setup-toolchain@main @@ -61,7 +54,7 @@ jobs: sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100 pip install gcovr==6.0 - - name: Configure tests + - name: Configure run: | mkdir build cd build @@ -70,24 +63,19 @@ jobs: -DCMAKE_C_FLAGS="--coverage -fprofile-arcs -ftest-coverage -Werror" \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,-lgcov" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-lgcov" - make -j2 -k gtest_main yaml-cpp - - name: Build tests + - name: Build and run tests run: | - ccache -z cd build make -j2 -k check - ccache -sv - name: Generate coverage report run: | gcovr --gcov-executable ${{ github.workspace }}/.github/workflows/scripts/gcov.sh \ - --root ${{ github.workspace }}/test \ + --root ${{ github.workspace }} \ ${{ github.workspace }}/build \ --filter ${{ github.workspace }}/include \ --filter ${{ github.workspace }}/src \ - --exclude-lines-by-pattern '^\s*$' \ - --exclude-lines-by-pattern '^\s*};$' \ --exclude-unreachable-branches \ --exclude-throw-branches \ --exclude-noncode-lines \ diff --git a/.github/workflows/ci_linux.yml b/.github/workflows/ci_linux.yml index 85109fd..cba423f 100644 --- a/.github/workflows/ci_linux.yml +++ b/.github/workflows/ci_linux.yml @@ -14,7 +14,6 @@ concurrency: cancel-in-progress: ${{ github.event_name != 'push' }} env: - SHARG_NO_VERSION_CHECK: 1 TZ: Europe/Berlin defaults: @@ -32,31 +31,24 @@ jobs: include: - name: "clang17" compiler: "clang-17" - build: unit build_type: Release cxx_flags: "-stdlib=libc++" - name: "gcc13" compiler: "gcc-13" - build: unit build_type: Release - name: "gcc12" compiler: "gcc-12" - build: unit build_type: Release - name: "gcc11" compiler: "gcc-11" - build: unit build_type: Release steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 1 - submodules: false - name: Setup toolchain uses: seqan/actions/setup-toolchain@main @@ -75,12 +67,6 @@ jobs: cd build cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Werror" - make -j2 -k gtest_main yaml-cpp - - - name: Build application - run: | - cd build - make -j2 -k - name: Build and run tests run: | diff --git a/.github/workflows/ci_macos.yml b/.github/workflows/ci_macos.yml index 18599cd..2011975 100644 --- a/.github/workflows/ci_macos.yml +++ b/.github/workflows/ci_macos.yml @@ -14,7 +14,6 @@ concurrency: cancel-in-progress: ${{ github.event_name != 'push' }} env: - SHARG_NO_VERSION_CHECK: 1 TZ: Europe/Berlin defaults: @@ -32,31 +31,24 @@ jobs: include: - name: "clang17" compiler: "clang-17" - build: unit build_type: Release cxx_flags: "-stdlib=libc++" # For verbosity. This is already the default. - name: "gcc13" compiler: "gcc-13" - build: unit build_type: Release - name: "gcc12" compiler: "gcc-12" - build: unit build_type: Release - name: "gcc11" compiler: "gcc-11" - build: unit build_type: Release steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 1 - submodules: false - name: Setup toolchain uses: seqan/actions/setup-toolchain@main @@ -75,12 +67,6 @@ jobs: cd build cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Werror" - make -j3 -k gtest_main yaml-cpp - - - name: Build application - run: | - cd build - make -j3 -k - name: Build and run tests run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a4a7bc7..63a5546 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,9 +22,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 1 - submodules: false - name: Run clang-format uses: DoozyX/clang-format-lint-action@v0.17