diff options
author | dundargoc <gocdundar@gmail.com> | 2024-07-14 17:24:40 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-07-15 13:02:09 +0200 |
commit | 3c803483ac0db09fe4fd9dc81f618e7a247714cc (patch) | |
tree | af42aa18bcebeaa4e54ae25d3ae0be88e8513f8e | |
parent | 594c7f3d77262a1222c9786d86353a0595f2894c (diff) | |
download | rneovim-3c803483ac0db09fe4fd9dc81f618e7a247714cc.tar.gz rneovim-3c803483ac0db09fe4fd9dc81f618e7a247714cc.tar.bz2 rneovim-3c803483ac0db09fe4fd9dc81f618e7a247714cc.zip |
ci: adjust workflows to enable required checks
Auto-merging is a useful feature by github, but it requires required
checks which requires a few adjustments. The primary change is that
required checks can't use `paths` or `paths-ignore` as that risks not
running the job, and required checks must always be run.
A workaround for this is to introduce a dummy workflow which is used for
every path not used in the real workflow. That way the required job is
"always" run as far as github is concerned. The workaround is unweildly
so it's only useful to do it for costly workflows where the potential
benefits are big. If not it's better to simply remove any `paths` or
`paths-ignore` from a workflow instead.
-rw-r--r-- | .github/workflows/build_dummy.yml | 33 | ||||
-rw-r--r-- | .github/workflows/docs.yml | 7 | ||||
-rw-r--r-- | .github/workflows/test.yml | 21 |
3 files changed, 45 insertions, 16 deletions
diff --git a/.github/workflows/build_dummy.yml b/.github/workflows/build_dummy.yml new file mode 100644 index 0000000000..b499ba7fa2 --- /dev/null +++ b/.github/workflows/build_dummy.yml @@ -0,0 +1,33 @@ +name: build_dummy +on: + pull_request: + branches: + - 'master' + - 'release-[0-9]+.[0-9]+' + # This needs to be an exact complement of `paths` in the build.yml workflow. + # This is required to bypass required checks since a required job is always + # needed to run. + paths-ignore: + - '**.cmake' + - '**/CMakeLists.txt' + - '**/CMakePresets.json' + - 'cmake.*/**' + - '.github/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + old-cmake: + name: Test oldest supported cmake + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - run: echo "success" + + use-existing-src: + name: Test USE_EXISTING_SRC_DIR=ON builds with no network access + runs-on: ubuntu-latest + steps: + - run: echo "success" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c91f2945fb..f132404382 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,13 +2,6 @@ name: docs on: pull_request: types: [opened, synchronize, reopened, ready_for_review] - paths: - - 'src/nvim/api/*.[ch]' - - 'src/nvim/eval.lua' - - 'runtime/lua/**.lua' - - 'runtime/doc/**' - - 'scripts/gen_vimdoc.py' - - 'scripts/gen_help_html.lua' jobs: docs: runs-on: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d0ee18ab73..b6767e71b1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,8 +8,6 @@ on: branches: - 'master' - 'release-[0-9]+.[0-9]+' - paths-ignore: - - 'contrib/**' workflow_dispatch: concurrency: @@ -95,18 +93,23 @@ jobs: - run: cmake --build build --target clang-analyzer posix: - name: ${{ matrix.build.runner }} ${{ matrix.build.flavor }} ${{ matrix.build.cc }} ${{ matrix.test }} + name: ${{ matrix.build.os }} ${{ matrix.build.flavor }} ${{ matrix.build.cc }} ${{ matrix.test }} strategy: fail-fast: false matrix: + # The `os` field is not needed to differentiate between the different + # matrix builds. It is needed to not change the required checks (which + # uses jobs names) each time we bump the runner version. It may be + # possible to remove if we e.g. start using `-latest` runner versions + # or if github introduces a wildcard for required checks in the future. build: [ - { runner: ubuntu-22.04, flavor: asan, cc: clang, flags: -D ENABLE_ASAN_UBSAN=ON }, - { runner: ubuntu-22.04, flavor: tsan, cc: clang, flags: -D ENABLE_TSAN=ON }, - { runner: ubuntu-22.04, cc: gcc }, - { runner: macos-12, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER }, - { runner: macos-14, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER }, - { runner: ubuntu-22.04, flavor: puc-lua, cc: gcc, deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON, flags: -D PREFER_LUA=ON }, + { runner: ubuntu-22.04, os: ubuntu, flavor: asan, cc: clang, flags: -D ENABLE_ASAN_UBSAN=ON }, + { runner: ubuntu-22.04, os: ubuntu, flavor: tsan, cc: clang, flags: -D ENABLE_TSAN=ON }, + { runner: ubuntu-22.04, os: ubuntu, cc: gcc }, + { runner: macos-12, os: macos, flavor: 12, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER }, + { runner: macos-14, os: macos, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER }, + { runner: ubuntu-22.04, os: ubuntu, flavor: puc-lua, cc: gcc, deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON, flags: -D PREFER_LUA=ON }, ] test: [unittest, functionaltest, oldtest] exclude: |