diff options
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/add-reviewers.yml | 6 | ||||
| -rw-r--r-- | .github/workflows/api-docs-check.yml | 18 | ||||
| -rw-r--r-- | .github/workflows/api-docs.yml | 74 | ||||
| -rw-r--r-- | .github/workflows/backport.yml | 17 | ||||
| -rw-r--r-- | .github/workflows/build.yml | 94 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 351 | ||||
| -rw-r--r-- | .github/workflows/codeql.yml | 33 | ||||
| -rw-r--r-- | .github/workflows/coverity.yml | 6 | ||||
| -rw-r--r-- | .github/workflows/env.ps1 | 7 | ||||
| -rwxr-xr-x | .github/workflows/env.sh | 68 | ||||
| -rw-r--r-- | .github/workflows/issue-open-check.yml | 34 | ||||
| -rw-r--r-- | .github/workflows/labeler.yml | 15 | ||||
| -rw-r--r-- | .github/workflows/lintcommit.yml | 22 | ||||
| -rw-r--r-- | .github/workflows/news.yml | 11 | ||||
| -rw-r--r-- | .github/workflows/notes.md | 27 | ||||
| -rw-r--r-- | .github/workflows/optional.yml | 41 | ||||
| -rw-r--r-- | .github/workflows/release.yml | 160 | ||||
| -rw-r--r-- | .github/workflows/remove-reviewers.yml | 5 | ||||
| -rw-r--r-- | .github/workflows/response.yml | 35 | ||||
| -rw-r--r-- | .github/workflows/stale.yml | 42 | ||||
| -rw-r--r-- | .github/workflows/test.yml | 342 | ||||
| -rw-r--r-- | .github/workflows/vim-patches.yml | 8 |
22 files changed, 670 insertions, 746 deletions
diff --git a/.github/workflows/add-reviewers.yml b/.github/workflows/add-reviewers.yml index f1abab5c53..22c68b6ef7 100644 --- a/.github/workflows/add-reviewers.yml +++ b/.github/workflows/add-reviewers.yml @@ -2,6 +2,7 @@ name: "Request reviews" on: pull_request_target: types: [labeled, ready_for_review, reopened] + workflow_call: jobs: request-reviewer: if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false @@ -9,11 +10,10 @@ jobs: permissions: pull-requests: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Request reviewers' - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: - github-token: ${{ secrets.TEAM_REVIEW }} script: | const script = require('./.github/scripts/reviews.js') await script({github, context}) diff --git a/.github/workflows/api-docs-check.yml b/.github/workflows/api-docs-check.yml deleted file mode 100644 index 0a57df7c33..0000000000 --- a/.github/workflows/api-docs-check.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Missing API docs -on: - pull_request: - branches-ignore: - - 'marvim/api-doc-update**' - paths: - - 'src/nvim/api/*.[ch]' - - 'runtime/lua/**.lua' - - 'runtime/doc/**' - -jobs: - call-regen-api-docs: - permissions: - contents: write - pull-requests: write - uses: ./.github/workflows/api-docs.yml - with: - check_only: true diff --git a/.github/workflows/api-docs.yml b/.github/workflows/api-docs.yml index fa8a7dbca0..6f8fe107d2 100644 --- a/.github/workflows/api-docs.yml +++ b/.github/workflows/api-docs.yml @@ -1,74 +1,34 @@ -# Autogenerate the API docs on new commit to important branches -# Also work as a check for PR's to not forget committing their doc changes -# called from api-docs-check.yml -name: Autogenerate API docs +# Check if any PR needs to run the autogenerate script +name: Autogenerate API docs and types on: - push: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] paths: - 'src/nvim/api/*.[ch]' + - 'src/nvim/eval.lua' - 'runtime/lua/**.lua' - 'runtime/doc/**' - branches: - - 'master' - - 'release-[0-9]+.[0-9]+' - workflow_dispatch: - workflow_call: - inputs: - check_only: - type: boolean - default: false - required: false jobs: - regen-api-docs: + regen-api-docs-and-types: runs-on: ubuntu-latest + if: github.event.pull_request.draft == false permissions: contents: write pull-requests: write - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: rhysd/action-setup-vim@v1 - with: - neovim: true - version: nightly - - uses: actions/checkout@v3 - with: - # Fetch depth 0 is required if called through workflow_call. In order - # to create a PR we need to access other branches, which requires a - # full clone. - fetch-depth: 0 - + - uses: actions/checkout@v4 - name: Install dependencies run: | - sudo apt-get update - sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen python3 python3-msgpack - - - name: Setup git config - run: | - git config --global user.name 'marvim' - git config --global user.email 'marvim@users.noreply.github.com' - - - run: printf 'DOC_BRANCH=marvim/api-doc-update/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV + ./.github/scripts/install_deps.sh + sudo apt-get install -y doxygen python3-msgpack + - uses: ./.github/actions/cache - name: Generate docs - id: docs - run: | - git checkout -b ${DOC_BRANCH} - python3 scripts/gen_vimdoc.py - printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT - - - name: FAIL, PR has not committed doc changes - if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }} - run: | - echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes" - echo "The doc generation produces the following changes:" - git diff --color --exit-code - - - name: Automatic PR - if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }} run: | - git add -u - git commit -m 'docs: regenerate [skip ci]' - git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH} - gh pr create --draft --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true + make doc + if [ -n "$(git status --porcelain)" ]; then + echo "::error::Job failed, run 'make doc' and commit your doc changes." + echo "::error::The doc generation produces the following changes:" + git diff --color --exit-code + fi diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 019fb20689..321cd02b0c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -8,20 +8,9 @@ jobs: contents: write pull-requests: write name: Backport Pull Request - if: > - github.repository_owner == 'neovim' && ( - github.event_name == 'pull_request_target' && - github.event.pull_request.merged - ) + if: github.event.pull_request.merged runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - # required to find all branches - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/checkout@v4 - name: Create backport PRs - uses: zeebe-io/backport-action@v0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - github_workspace: ${{ github.workspace }} + uses: korthout/backport-action@v2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..d6e11fcdcb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,94 @@ +name: build +on: + pull_request: + branches: + - 'master' + - 'release-[0-9]+.[0-9]+' + paths: + - '**.cmake' + - '**/CMakeLists.txt' + - '**/CMakePresets.json' + - 'cmake.*/**' + - '.github/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +env: + BIN_DIR: ${{ github.workspace }}/bin + INSTALL_PREFIX: ${{ github.workspace }}/nvim-install + +jobs: + macos-universal: + runs-on: macos-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - run: ./.github/scripts/install_deps.sh + - run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV + + - name: Build universal binary + run: ./.github/scripts/build_universal_macos.sh + + old-cmake: + name: Test oldest supported cmake + runs-on: ubuntu-22.04 + timeout-minutes: 15 + env: + CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh' + CMAKE_VERSION: '3.10.0' + steps: + - uses: actions/checkout@v4 + - run: ./.github/scripts/install_deps.sh + + - name: Set up environment + run: echo "$BIN_DIR" >> $GITHUB_PATH + + + - name: Install minimum required version of cmake + run: | + curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL" + mkdir -p "$BIN_DIR" /opt/cmake-custom + chmod a+x /tmp/cmake-installer.sh + /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license + ln -sfn /opt/cmake-custom/bin/cmake "$BIN_DIR/cmake" + cmake_version="$(cmake --version | head -1)" + echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || { + echo "Unexpected CMake version: $cmake_version" + exit 1 + } + + - name: Build dependencies + run: make deps + + - name: Build + run: make CMAKE_FLAGS="-D CI_BUILD=ON -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX" + + - name: Install + run: make install + + use-existing-src: + name: Test USE_EXISTING_SRC_DIR=ON builds with no network access + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - run: ./.github/scripts/install_deps.sh + + - name: Build bundled dependencies + run: make deps + + - name: Clean bundled dependencies à la neovim/deps + run: | + rm -rf ./build + find .deps .deps/build -maxdepth 1 '!' \( -name .deps -o -name build -o -name src \) -exec rm -r '{}' + + cd .deps/build/src + rm -rf ./*-build + rm -rf ./*-stamp/*-{configure,build,install,done} + for d in *; do (cd "$d"; rm -rf ./autom4te.cache; make clean || true; make distclean || true); done + + - name: Re-build bundled dependencies with no network access + run: unshare --map-root-user --net make deps DEPS_CMAKE_FLAGS=-DUSE_EXISTING_SRC_DIR=ON + + - name: Build + run: make CMAKE_FLAGS="-D CI_BUILD=ON" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index b158d966e1..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,351 +0,0 @@ -name: CI -on: - push: - branches: - - 'master' - - 'release-[0-9]+.[0-9]+' - pull_request: - branches: - - 'master' - - 'release-[0-9]+.[0-9]+' - paths-ignore: - - 'contrib/**' - -# Cancel any in-progress CI runs for a PR if it is updated -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -env: - UNCRUSTIFY_VERSION: uncrustify-0.75.0 - # TEST_FILE: test/functional/core/startup_spec.lua - # TEST_FILTER: foo - -jobs: - lint: - if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master') - runs-on: ubuntu-22.04 - timeout-minutes: 10 - env: - CC: gcc - steps: - - uses: actions/checkout@v3 - - - name: Setup common environment variables - run: ./.github/workflows/env.sh lint - - - name: Install apt packages - run: | - ./.github/scripts/install_deps_ubuntu.sh - sudo apt-get install -y lua-check - - - name: Cache uncrustify - id: cache-uncrustify - uses: actions/cache@v3 - with: - path: ${{ env.CACHE_UNCRUSTIFY }} - key: ${{ env.UNCRUSTIFY_VERSION }} - - - name: Clone uncrustify - if: steps.cache-uncrustify.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: uncrustify/uncrustify - ref: ${{ env.UNCRUSTIFY_VERSION }} - path: uncrustify - - - name: Install uncrustify - if: steps.cache-uncrustify.outputs.cache-hit != 'true' - run: | - source_dir=uncrustify - build_dir=uncrustify/build - cmake -S $source_dir -B $build_dir -G Ninja -DCMAKE_BUILD_TYPE=Release - cmake --build $build_dir - mkdir -p $HOME/.cache - cp $build_dir/uncrustify ${{ env.CACHE_UNCRUSTIFY }} - - - uses: ./.github/actions/cache - - - name: Build third-party deps - run: ./ci/before_script.sh - - - if: "!cancelled()" - name: Determine if run should be aborted - id: abort_job - run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: lintstylua - uses: JohnnyMorganz/stylua-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: latest - args: --check runtime/ - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: luacheck - run: | - cmake -B $BUILD_DIR -G Ninja - cmake --build $BUILD_DIR --target lintlua-luacheck - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: lintsh - run: make lintsh - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: uncrustify - run: | - ${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]") - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: suggester / uncrustify - uses: reviewdog/action-suggester@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - tool_name: uncrustify - cleanup: false - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: check uncrustify - run: | - git diff --color --exit-code - - - name: Cache dependencies - run: ./ci/before_cache.sh - - lintc: - # This job tests two things: it lints the code but also builds neovim using - # system dependencies instead of bundled dependencies. This is to make sure - # we are able to build neovim without pigeonholing ourselves into specifics - # of the bundled dependencies. - - if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master') - runs-on: ubuntu-22.04 - timeout-minutes: 10 - env: - CC: gcc - steps: - - uses: actions/checkout@v3 - - - name: Setup common environment variables - run: ./.github/workflows/env.sh lint - - - name: Install apt packages - run: | - sudo add-apt-repository ppa:neovim-ppa/stable - ./.github/scripts/install_deps_ubuntu.sh - sudo apt-get install -y \ - libluajit-5.1-dev \ - libmsgpack-dev \ - libtermkey-dev \ - libtree-sitter-dev \ - libunibilium-dev \ - libuv1-dev \ - libvterm-dev \ - lua-busted \ - lua-filesystem \ - lua-inspect \ - lua-lpeg \ - lua-luv-dev \ - lua-nvim \ - luajit - - - uses: ./.github/actions/cache - - - name: Build third-party deps - run: ./ci/before_script.sh - - - name: Build nvim - run: ./ci/run_tests.sh build_nvim - - - if: "!cancelled()" - name: Determine if run should be aborted - id: abort_job - run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: clint.py - run: cmake --build build --target lintc-clint - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: check-single-includes - run: make check-single-includes - - - name: Cache dependencies - run: ./ci/before_cache.sh - - posix: - name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }}) - strategy: - fail-fast: false - matrix: - include: - - flavor: asan - cc: clang - runner: ubuntu-22.04 - os: linux - - flavor: tsan - cc: clang - runner: ubuntu-22.04 - os: linux - - flavor: uchar - cc: gcc - runner: ubuntu-22.04 - os: linux - - cc: clang - runner: macos-12 - os: osx - - # functionaltest-lua is our dumping ground for non-mainline configurations. - # 1. Check that the tests pass with PUC Lua instead of LuaJIT. - # 2. Use as oldest/minimum versions of dependencies/build tools we - # still explicitly support so we don't accidentally rely on - # features that is only available on later versions. - # 3. No treesitter parsers installed. - - flavor: functionaltest-lua - cc: gcc - runner: ubuntu-22.04 - os: linux - cmake: minimum_required - runs-on: ${{ matrix.runner }} - timeout-minutes: 45 - env: - CC: ${{ matrix.cc }} - CI_OS_NAME: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - - name: Setup common environment variables - run: ./.github/workflows/env.sh ${{ matrix.flavor }} - - - name: Install apt packages - if: matrix.os == 'linux' - run: ./.github/scripts/install_deps_ubuntu.sh - - - name: Install minimum required version of cmake - if: matrix.cmake == 'minimum_required' - env: - CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh' - CMAKE_VERSION: '3.10.0' - shell: bash - run: | - curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL" - mkdir -p "$HOME/.local/bin" /opt/cmake-custom - chmod a+x /tmp/cmake-installer.sh - /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license - ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake" - cmake_version="$(cmake --version | head -1)" - echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || { - echo "Unexpected CMake version: $cmake_version" - exit 1 - } - - - name: Install brew packages - if: matrix.os == 'osx' - run: | - brew update --quiet - brew install automake cpanminus ninja - - - name: Setup interpreter packages - run: ./ci/install.sh - - - uses: ./.github/actions/cache - - - name: Build third-party deps - run: ./ci/before_script.sh - - - name: Build - run: ./ci/run_tests.sh build_nvim - - - if: "!cancelled()" - name: Determine if run should be aborted - id: abort_job - run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT - - - if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success') - name: Unittests - run: ./ci/run_tests.sh unittests - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: Functionaltests - run: ./ci/run_tests.sh functionaltests - - - if: matrix.flavor != 'tsan' && (success() || failure() && steps.abort_job.outputs.status == 'success') - name: Oldtests - run: ./ci/run_tests.sh oldtests - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: Install nvim - run: ./ci/run_tests.sh install_nvim - - - name: Cache dependencies - run: ./ci/before_cache.sh - - windows: - runs-on: windows-2019 - timeout-minutes: 45 - env: - DEPS_BUILD_DIR: ${{ github.workspace }}/nvim-deps - CACHE_NVIM_DEPS_DIR: ${{ github.workspace }}/nvim-deps - DEPS_PREFIX: ${{ github.workspace }}/nvim-deps/usr - name: windows (MSVC_64) - steps: - - uses: actions/checkout@v3 - - - uses: ./.github/actions/cache - - - name: Set env - run: ./.github/workflows/env.ps1 - - - name: Build deps - run: | - cmake -S cmake.deps -B $env:DEPS_BUILD_DIR -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo' - cmake --build $env:DEPS_BUILD_DIR - - - name: Build nvim - run: | - cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo' -DDEPS_PREFIX="$env:DEPS_PREFIX" -DCI_BUILD=ON - cmake --build build - - - name: Install test deps - run: | - $PSNativeCommandArgumentPassing = 'Legacy' - - & build\bin\nvim.exe "--version" - - # Ensure that the "win32" feature is set. - & build\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' - - python -m pip install pynvim - # Sanity check - python -c "import pynvim; print(str(pynvim))" - - gem.cmd install --pre neovim - Get-Command -CommandType Application neovim-ruby-host.bat - - node --version - npm.cmd --version - - npm.cmd install -g neovim - Get-Command -CommandType Application neovim-node-host.cmd - npm.cmd link neovim - - - if: "!cancelled()" - name: Determine if run should be aborted - id: abort_job - run: | - "status=${{ job.status }}" >> $env:GITHUB_OUTPUT - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: Run functionaltests - run: cmake --build build --target functionaltest - - - if: success() || failure() && steps.abort_job.outputs.status == 'success' - name: Run oldtests - run: | - # Add MSYS to path, required for e.g. `find` used in test scripts. - # But would break functionaltests, where its `more` would be used then. - $OldPath = $env:PATH - $env:PATH = "C:\msys64\usr\bin;$env:PATH" - & "C:\msys64\mingw64\bin\mingw32-make.exe" -C $(Convert-Path src\nvim\testdir) VERBOSE=1 - $env:PATH = $OldPath diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a11a87f93a..365c3fdf56 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,9 +1,15 @@ name: "CodeQL" +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + on: - schedule: - - cron: '42 0 * * 0' - workflow_dispatch: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] jobs: analyze: name: Analyze @@ -13,28 +19,21 @@ jobs: contents: read security-events: write - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Setup common environment variables - run: ./.github/workflows/env.sh - - - name: Install apt packages - run: ./.github/scripts/install_deps_ubuntu.sh + - name: Install dependencies + run: ./.github/scripts/install_deps.sh - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: - languages: ${{ matrix.language }} + languages: cpp + + - uses: ./.github/actions/cache - - if: matrix.language == 'cpp' - run: make + - run: make - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 87e2cb1453..3eed1e51df 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -8,12 +8,10 @@ jobs: scan: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip + run: ./.github/scripts/install_deps.sh - name: Download Coverity run: | diff --git a/.github/workflows/env.ps1 b/.github/workflows/env.ps1 deleted file mode 100644 index 8ac267f2f9..0000000000 --- a/.github/workflows/env.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) { - & "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object { - $name, $value = $_ -split '=', 2 - "$name=$value" >> $env:GITHUB_ENV - } -} diff --git a/.github/workflows/env.sh b/.github/workflows/env.sh deleted file mode 100755 index d93552fed3..0000000000 --- a/.github/workflows/env.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -set -e -u - -FLAVOR=${1:-} - -cat <<EOF >> "$GITHUB_PATH" -$HOME/.local/bin -EOF - -cat <<EOF >> "$GITHUB_ENV" -CI_BUILD_DIR=$GITHUB_WORKSPACE -BUILD_DIR=$GITHUB_WORKSPACE/build -DEPS_BUILD_DIR=$HOME/nvim-deps -INSTALL_PREFIX=$HOME/nvim-install -LOG_DIR=$GITHUB_WORKSPACE/build/log -NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog -VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log -CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps -CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker -CACHE_UNCRUSTIFY=$HOME/.cache/uncrustify -EOF - -DEPS_CMAKE_FLAGS= -FUNCTIONALTEST=functionaltest -BUILD_FLAGS="CMAKE_FLAGS=-DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$HOME/nvim-install -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$HOME/nvim-deps/usr -DMIN_LOG_LEVEL=3" - -case "$FLAVOR" in - asan) - BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON" - cat <<EOF >> "$GITHUB_ENV" -CLANG_SANITIZER=ASAN_UBSAN -ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0 -UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan -EOF - ;; - tsan) - cat <<EOF >> "$GITHUB_ENV" -TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan -CLANG_SANITIZER=TSAN -EOF - ;; - uchar) - cat <<EOF >> "$GITHUB_ENV" -BUILD_UCHAR=1 -EOF - ;; - lint) -# Re-enable once system deps are available -# BUILD_FLAGS="$BUILD_FLAGS -DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/lua/5.1/luv.so -DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1" - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON" - cat <<EOF >> "$GITHUB_ENV" -USE_BUNDLED=OFF -EOF - ;; - functionaltest-lua) - BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON" - FUNCTIONALTEST=functionaltest-lua - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF" - ;; - *) - ;; -esac - -cat <<EOF >> "$GITHUB_ENV" -$BUILD_FLAGS -DEPS_CMAKE_FLAGS=$DEPS_CMAKE_FLAGS -FUNCTIONALTEST=$FUNCTIONALTEST -EOF diff --git a/.github/workflows/issue-open-check.yml b/.github/workflows/issue-open-check.yml new file mode 100644 index 0000000000..eac1c2ee4d --- /dev/null +++ b/.github/workflows/issue-open-check.yml @@ -0,0 +1,34 @@ +name: Issue Open Check + +on: + issues: + types: [opened] + +jobs: + issue-open-check: + permissions: + issues: write + runs-on: ubuntu-latest + steps: + - name: check issue title + id: check-issue + uses: actions/github-script@v7 + with: + script: | + const title = context.payload.issue.title; + const titleSplit = title.split(/\s+/).map(e => e.toLowerCase()); + const keywords = ['api', 'treesitter', 'ui', 'lsp']; + var match = new Set(); + for (const keyword of keywords) { + if (titleSplit.includes(keyword)) { + match.add(keyword) + } + } + if (match.size !== 0) { + github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: Array.from(match) + }) + } diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 60689029a3..52682d93dd 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -3,7 +3,6 @@ on: pull_request_target: types: [opened] jobs: - triage: runs-on: ubuntu-latest permissions: @@ -12,10 +11,10 @@ jobs: steps: - uses: actions/labeler@v4 with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: "" type-scope: + needs: triage runs-on: ubuntu-latest permissions: contents: write @@ -34,17 +33,7 @@ jobs: run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true request-reviewer: - if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false - runs-on: ubuntu-latest needs: ["triage", "type-scope"] permissions: pull-requests: write - steps: - - uses: actions/checkout@v3 - - name: 'Request reviewers' - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.TEAM_REVIEW }} - script: | - const script = require('./.github/scripts/reviews.js') - await script({github, context}) + uses: ./.github/workflows/add-reviewers.yml diff --git a/.github/workflows/lintcommit.yml b/.github/workflows/lintcommit.yml index a7a227865d..8f56c057ae 100644 --- a/.github/workflows/lintcommit.yml +++ b/.github/workflows/lintcommit.yml @@ -8,16 +8,20 @@ jobs: lint-commits: runs-on: ubuntu-latest if: github.event.pull_request.draft == false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - path: pr_nvim - - uses: rhysd/action-setup-vim@v1 - with: - neovim: true - - run: wget https://raw.githubusercontent.com/neovim/neovim/master/scripts/lintcommit.lua - - run: nvim --clean -es +"cd pr_nvim" +"lua dofile('../lintcommit.lua').main({trace=true})" + + - run: ./.github/scripts/install_deps.sh + - uses: ./.github/actions/cache + - name: Build + run: | + cmake -S cmake.deps --preset ci |