From 48241c3b238e0cf5b4b5af61db4e54f2b8c02897 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 9 Aug 2022 17:05:56 +0200 Subject: ci(release): bump deprecated ubuntu image to 20.04 `ubuntu-18.04` is now deprecated and subject to outages, see https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/ --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cab57add52..cbb7bf64b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ on: # Upgrade to gcc-11 to prevent it from using its builtins (#14150) jobs: linux: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 outputs: version: ${{ steps.build.outputs.version }} release: ${{ steps.build.outputs.release }} @@ -50,7 +50,7 @@ jobs: retention-days: 1 appimage: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: @@ -150,7 +150,7 @@ jobs: publish: needs: [linux, appimage, macOS, windows] - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- cgit From d212dfd676a32fc7c205c43cf58f86a7a02d0440 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 9 Aug 2022 17:35:19 +0200 Subject: ci(release): build with standard gcc on Ubuntu Ubuntu-20.04 ships with GCC 10.3.0, which is enough to avoid #14150 --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cbb7bf64b4..3b5c992fc7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ on: - v[0-9]+.[0-9]+.[0-9]+ # Build on the oldest supported images, so we have broader compatibility -# Upgrade to gcc-11 to prevent it from using its builtins (#14150) +# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04) jobs: linux: runs-on: ubuntu-20.04 @@ -27,7 +27,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext libtool-bin locales ninja-build pkg-config unzip + sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') @@ -35,7 +35,7 @@ jobs: - name: Build release id: build run: | - CC=gcc-11 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=" + CC=gcc-10 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=" printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')" printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)" make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install @@ -58,11 +58,11 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext libtool-bin locales ninja-build pkg-config unzip + sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') - run: CC=gcc-11 make appimage-latest + run: CC=gcc-10 make appimage-latest - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') - run: CC=gcc-11 make appimage-nightly + run: CC=gcc-10 make appimage-nightly - uses: actions/upload-artifact@v3 with: name: appimage -- cgit From 5b80d202712876f63050f783df1af42612acab2f Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Thu, 11 Aug 2022 10:07:38 +0100 Subject: ci(cache): remove ccache It was never in action since migrating from travis to github actions. --- .github/workflows/ci.yml | 7 ++----- .github/workflows/env.sh | 5 ----- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d670db5fac..74940c762f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,6 @@ jobs: autoconf \ automake \ build-essential \ - ccache \ cmake \ flake8 \ gettext \ @@ -97,7 +96,6 @@ jobs: with: path: | ${{ env.CACHE_NVIM_DEPS_DIR }} - ~/.ccache key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }} - name: Build third-party deps @@ -190,7 +188,7 @@ jobs: if: matrix.os == 'linux' run: | sudo apt-get update - sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip + sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip - name: Install minimum required version of cmake if: matrix.cmake == 'minimum_required' @@ -222,7 +220,7 @@ jobs: if: matrix.os == 'osx' run: | brew update --quiet - brew install automake ccache cpanminus ninja + brew install automake cpanminus ninja - name: Setup interpreter packages run: ./ci/install.sh @@ -232,7 +230,6 @@ jobs: with: path: | ${{ env.CACHE_NVIM_DEPS_DIR }} - ~/.ccache key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'cmake.deps/**', '**/CMakeLists.txt') }}-${{ github.base_ref }} - name: Build third-party deps diff --git a/.github/workflows/env.sh b/.github/workflows/env.sh index e7c9d19f3a..061588da1a 100755 --- a/.github/workflows/env.sh +++ b/.github/workflows/env.sh @@ -8,7 +8,6 @@ $HOME/.local/bin EOF cat <> "$GITHUB_ENV" -CACHE_ENABLE=true CI_BUILD_DIR=$GITHUB_WORKSPACE BUILD_DIR=$GITHUB_WORKSPACE/build DEPS_BUILD_DIR=$HOME/nvim-deps @@ -20,10 +19,6 @@ CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker CACHE_UNCRUSTIFY=$HOME/.cache/uncrustify UNCRUSTIFY_VERSION=uncrustify-0.75.0 -CCACHE_BASEDIR=$GITHUB_WORKSPACE -CCACHE_COMPRESS=1 -CCACHE_SLOPPINESS=time_macros,file_macro -CCACHE_DIR=$HOME/.ccache EOF DEPS_CMAKE_FLAGS= -- cgit From f9a9956837223b45a266c6cd3294caeb25be5972 Mon Sep 17 00:00:00 2001 From: Vedant <83997633+vedantmgoyal2009@users.noreply.github.com> Date: Sat, 13 Aug 2022 19:04:28 +0530 Subject: ci(release): move release-winget steps into release job #19689 --- .github/workflows/release-winget.yml | 12 ------------ .github/workflows/release.yml | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 .github/workflows/release-winget.yml (limited to '.github/workflows') diff --git a/.github/workflows/release-winget.yml b/.github/workflows/release-winget.yml deleted file mode 100644 index c3ca5fe752..0000000000 --- a/.github/workflows/release-winget.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Publish to WinGet -on: - release: - types: [released] -jobs: - publish: - runs-on: windows-latest # action can only be run on windows - steps: - - uses: vedantmgoyal2009/winget-releaser@latest - with: - identifier: Neovim.Neovim - token: ${{ secrets.WINGET_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b5c992fc7..d6933e9330 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -227,3 +227,16 @@ jobs: if [ "$TAG_NAME" != "nightly" ]; then gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/* fi + publish-winget: + needs: publish # run after publish job is finished + # publish to winget only on stable releases + if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') + runs-on: windows-latest # action can only be run on windows + steps: + - uses: vedantmgoyal2009/winget-releaser@latest + with: + identifier: Neovim.Neovim + # the latter one is a fallback value, reference: + # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value + release-tag: ${{ github.event.inputs.tag_name || github.ref }} + token: ${{ secrets.WINGET_TOKEN }} -- cgit From 1dc984eaabca97fa59c64e5c4588e98301da6cd6 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 14 Aug 2022 13:49:10 +0100 Subject: ci(lint): generate PR suggestions from uncrustify --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74940c762f..c87b36e7e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,6 +119,18 @@ jobs: name: uncrustify run: | ${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]") + + - if: "!cancelled()" + name: suggester / uncrustify + uses: reviewdog/action-suggester@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tool_name: uncrustify + cleanup: false + + - if: "!cancelled()" + name: check uncrustify + run: | git diff --color --exit-code - if: "!cancelled()" -- cgit From 0fcc32b707f32d6519916708ab5388f8d6848877 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 14 Aug 2022 14:08:38 +0100 Subject: ci(lint): run uncrustify earlier --- .github/workflows/ci.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c87b36e7e4..d2b451f980 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,23 +98,6 @@ jobs: ${{ env.CACHE_NVIM_DEPS_DIR }} key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }} - - name: Build third-party deps - run: ./ci/before_script.sh - - - name: Build nvim - run: ./ci/run_tests.sh build_nvim - - - if: "!cancelled()" - name: lintcfull - run: make lintcfull - - - if: "!cancelled()" - name: lintstylua - uses: JohnnyMorganz/stylua-action@1.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --check runtime/ - - if: "!cancelled()" name: uncrustify run: | @@ -133,6 +116,23 @@ jobs: run: | git diff --color --exit-code + - name: Build third-party deps + run: ./ci/before_script.sh + + - name: Build nvim + run: ./ci/run_tests.sh build_nvim + + - if: "!cancelled()" + name: lintcfull + run: make lintcfull + + - if: "!cancelled()" + name: lintstylua + uses: JohnnyMorganz/stylua-action@1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --check runtime/ + - if: "!cancelled()" name: lintlua run: make lintlua -- cgit From 49e691f58fcfb3da40921430cc03d30e53b44b00 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 14 Aug 2022 14:54:52 +0100 Subject: ci(line): lintcfull -> lintc lintcfull == lintc + uncrustify We are already running uncrustify separately so can just run lintc instead. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2b451f980..9d35e10046 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,8 +123,8 @@ jobs: run: ./ci/run_tests.sh build_nvim - if: "!cancelled()" - name: lintcfull - run: make lintcfull + name: lintc + run: make lintc - if: "!cancelled()" name: lintstylua -- cgit From 27c3919a48b5a8bccdcf4806ddcde3add1dac4e7 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 14 Aug 2022 14:56:15 +0100 Subject: ci(lint): move some steps before build --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d35e10046..560ffa7710 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,28 @@ jobs: ${{ env.CACHE_NVIM_DEPS_DIR }} key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }} + - name: Build third-party deps + run: ./ci/before_script.sh + + - if: "!cancelled()" + name: lintstylua + uses: JohnnyMorganz/stylua-action@1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --check runtime/ + + - if: "!cancelled()" + name: lintlua + run: make lintlua + + - if: "!cancelled()" + name: lintpy + run: make lintpy + + - if: "!cancelled()" + name: lintsh + run: make lintsh + - if: "!cancelled()" name: uncrustify run: | @@ -116,9 +138,6 @@ jobs: run: | git diff --color --exit-code - - name: Build third-party deps - run: ./ci/before_script.sh - - name: Build nvim run: ./ci/run_tests.sh build_nvim @@ -126,25 +145,6 @@ jobs: name: lintc run: make lintc - - if: "!cancelled()" - name: lintstylua - uses: JohnnyMorganz/stylua-action@1.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --check runtime/ - - - if: "!cancelled()" - name: lintlua - run: make lintlua - - - if: "!cancelled()" - name: lintpy - run: make lintpy - - - if: "!cancelled()" - name: lintsh - run: make lintsh - - if: "!cancelled()" name: check-single-includes run: make check-single-includes -- cgit From 0cd39c2f50f19df3ab8d176acf3a4b0b70e61412 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 14 Aug 2022 15:47:46 +0100 Subject: ci(lint): separate lintc from lint All steps in lint now do now require a Neovim build. --- .github/workflows/ci.yml | 66 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 560ffa7710..e22d99067a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,6 @@ concurrency: jobs: lint: - # 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-20.04 timeout-minutes: 10 @@ -65,7 +60,6 @@ jobs: ninja-build \ pkg-config - - name: Cache uncrustify id: cache-uncrustify uses: actions/cache@v3 @@ -138,6 +132,66 @@ jobs: 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-20.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 + sudo apt-get update + sudo apt-get install -y \ + autoconf \ + automake \ + build-essential \ + cmake \ + gettext \ + libluajit-5.1-dev \ + libmsgpack-dev \ + libtermkey-dev \ + libtool-bin \ + libtree-sitter-dev \ + libunibilium-dev \ + libuv1-dev \ + libvterm-dev \ + locales \ + lua-busted \ + lua-check \ + lua-filesystem \ + lua-inspect \ + lua-lpeg \ + lua-luv-dev \ + lua-nvim \ + luajit \ + ninja-build \ + pkg-config + + - name: Cache artifacts + uses: actions/cache@v3 + with: + path: | + ${{ env.CACHE_NVIM_DEPS_DIR }} + key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }} + + - name: Build third-party deps + run: ./ci/before_script.sh + - name: Build nvim run: ./ci/run_tests.sh build_nvim -- cgit From 39494be2a4caeb619846766a3701e18814ccf431 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 18 Aug 2022 11:55:15 +0200 Subject: ci: add codeql action (#19810) replaces deprecated LGTM workflow: https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/ --- .github/workflows/codeql-analysis.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml (limited to '.github/workflows') diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..b31382af37 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,42 @@ +name: "CodeQL" + +on: + schedule: + - cron: '42 0 * * 0' + workflow_dispatch: +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'cpp', 'python' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup common environment variables + run: ./.github/workflows/env.sh + + - name: Install apt packages + run: | + sudo apt-get update + sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - if: matrix.language == 'cpp' + run: make + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 -- cgit