From 9eb5d9f13fb24594007f5b0728826b1f9b694e3c Mon Sep 17 00:00:00 2001 From: dundargoc Date: Wed, 27 Sep 2023 17:53:06 +0200 Subject: [PATCH] ci: various cleanups - add reviewers - correct cache key --- .github/actions/cache/action.yml | 2 +- .github/scripts/reviews.js | 4 ++ .github/workflows/test.yml | 68 ++++++++++++++++++-------------- 3 files changed, 43 insertions(+), 31 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index e7ffdd66b6..698dfa3b3a 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -22,5 +22,5 @@ runs: with: path: .deps key: ${{ env.CACHE_KEY }}-${{ steps.image.outputs.version }}-${{ hashFiles('cmake**', - '.github/workflows/test.yml', 'CMakeLists.txt', + '.github/**', 'CMakeLists.txt', 'runtime/CMakeLists.txt', 'src/nvim/**/CMakeLists.txt') }} diff --git a/.github/scripts/reviews.js b/.github/scripts/reviews.js index 3e5394c4bd..8fae929421 100644 --- a/.github/scripts/reviews.js +++ b/.github/scripts/reviews.js @@ -64,6 +64,10 @@ module.exports = async ({ github, context }) => { reviewers.add("mfussenegger"); } + if (labels.includes("options")) { + reviewers.add("famiu"); + } + if (labels.includes("platform:nix")) { reviewers.add("teto"); } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c86ad5fcf..3cfc6eee89 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,8 +52,7 @@ jobs: cmake -S cmake.deps -B .deps -G Ninja cmake --build .deps - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - run: cmake -B build -G Ninja -D CI_LINT=ON + - run: cmake -B build -G Ninja -D CI_LINT=ON - if: "!cancelled()" name: Determine if run should be aborted @@ -77,6 +76,7 @@ jobs: run: cmake --build build --target lintc-clint - if: success() || failure() && steps.abort_job.outputs.status == 'success' + name: clang-tidy run: cmake --build build --target clang-tidy - if: success() || failure() && steps.abort_job.outputs.status == 'success' @@ -228,34 +228,6 @@ jobs: name: Show logs run: cat $(find "$LOG_DIR" -type f) - build-types: - runs-on: ubuntu-22.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - - name: Install dependencies - run: ./.github/scripts/install_deps.sh - - - uses: ./.github/actions/cache - - - name: Build third-party deps - run: | - cmake -S cmake.deps -B .deps -G "Ninja Multi-Config" - cmake --build .deps - - - name: Configure - run: cmake -B build -G "Ninja Multi-Config" -D CMAKE_C_COMPILER=gcc -D CI_BUILD=ON - - - name: Release - run: cmake --build build --config Release - - - name: RelWithDebInfo - run: cmake --build build --config RelWithDebInfo - - - name: MinSizeRel - run: cmake --build build --config MinSizeRel - windows: runs-on: windows-2022 timeout-minutes: 45 @@ -321,6 +293,42 @@ jobs: cd test/old/testdir mingw32-make VERBOSE=1 + # This job tests the following things: + # - Check if Release, MinSizeRel and RelWithDebInfo compiles correctly. + # - Test the above build types with the GCC compiler specifically. + # Empirically the difference in warning levels between GCC and other + # compilers is particularly big. + # - Test if the build works with multi-config generators. We mostly use + # single-config generators so it's nice to have a small sanity check for + # multi-config. + build-types: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: ./.github/scripts/install_deps.sh + + - uses: ./.github/actions/cache + + - name: Build third-party deps + run: | + cmake -S cmake.deps -B .deps -G "Ninja Multi-Config" + cmake --build .deps + + - name: Configure + run: cmake -B build -G "Ninja Multi-Config" -D CMAKE_C_COMPILER=gcc -D CI_BUILD=ON + + - name: Release + run: cmake --build build --config Release + + - name: RelWithDebInfo + run: cmake --build build --config RelWithDebInfo + + - name: MinSizeRel + run: cmake --build build --config MinSizeRel + with-external-deps: runs-on: ubuntu-22.04 timeout-minutes: 10