diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/ci.yml | 111 | ||||
-rw-r--r-- | .github/workflows/codeql-analysis.yml | 42 | ||||
-rwxr-xr-x | .github/workflows/env.sh | 5 | ||||
-rw-r--r-- | .github/workflows/release-winget.yml | 12 | ||||
-rw-r--r-- | .github/workflows/release.yml | 31 |
5 files changed, 151 insertions, 50 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d670db5fac..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 @@ -42,7 +37,6 @@ jobs: autoconf \ automake \ build-essential \ - ccache \ cmake \ flake8 \ gettext \ @@ -66,7 +60,6 @@ jobs: ninja-build \ pkg-config - - name: Cache uncrustify id: cache-uncrustify uses: actions/cache@v3 @@ -97,19 +90,11 @@ 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 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 @@ -118,12 +103,6 @@ jobs: args: --check runtime/ - if: "!cancelled()" - name: uncrustify - run: | - ${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]") - git diff --color --exit-code - - - if: "!cancelled()" name: lintlua run: make lintlua @@ -136,6 +115,91 @@ jobs: run: make lintsh - if: "!cancelled()" + 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 + + - 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 + + - if: "!cancelled()" + name: lintc + run: make lintc + + - if: "!cancelled()" name: check-single-includes run: make check-single-includes @@ -190,7 +254,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 +286,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 +296,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/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 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 <<EOF >> "$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= 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 cab57add52..d6933e9330 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,10 @@ 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-18.04 + runs-on: ubuntu-20.04 outputs: version: ${{ steps.build.outputs.version }} release: ${{ steps.build.outputs.release }} @@ -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 @@ -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: @@ -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 @@ -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 }} @@ -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 }} |