From 8cd4c114941936932559d29f64a57e39ab47c5f8 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 19 Feb 2022 19:11:28 -0500 Subject: ci(lint): install deps via apt instead of building from third-party --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34b73e8ef4..844ceb5927 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,19 +29,43 @@ jobs: - 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 ccache cmake gettext gperf libtool-bin locales ninja-build pkg-config flake8 - - - name: Cache dependencies + sudo apt-get install -y \ + autoconf \ + automake \ + build-essential \ + ccache \ + cmake \ + flake8 \ + gettext \ + gperf \ + 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@v2 with: path: | - ${{ env.CACHE_NVIM_DEPS_DIR }} ~/.ccache - key: lint-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }} - - - name: Build third-party - run: ./ci/before_script.sh + key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!third-party/**CMakeLists.txt') }}-${{ github.base_ref }} - if: "!cancelled()" name: clint -- cgit From 34cb26011ef4ef61988763839517610ca7a58b8c Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 19 Feb 2022 19:00:38 -0500 Subject: ci(lint): build against system deps --- .github/workflows/env.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/env.sh b/.github/workflows/env.sh index 0964995605..d424924c27 100755 --- a/.github/workflows/env.sh +++ b/.github/workflows/env.sh @@ -46,7 +46,9 @@ CLANG_SANITIZER=TSAN EOF ;; lint) + 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" cat <> "$GITHUB_ENV" +USE_BUNDLED=OFF CI_TARGET=lint EOF ;; -- cgit From 0c4c384ed166d4b59149dded959c3ce3b2b09f3e Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 19 Feb 2022 19:35:41 -0500 Subject: ci(lint): explicity build nvim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “make clint-full” bypasses the normal mechanisms used to communicate build flags in the CI jobs, so explicitly build nvim before running the lint jobs. --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 844ceb5927..0299849d9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,9 @@ jobs: ~/.ccache key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!third-party/**CMakeLists.txt') }}-${{ github.base_ref }} + - name: Build nvim + run: ./ci/run_tests.sh build + - if: "!cancelled()" name: clint run: ./ci/run_lint.sh clint -- cgit From 0adbe58bb242e945e4684bcadb40cbb293bff59e Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 19 Feb 2022 20:04:06 -0500 Subject: ci: ensure ~/.cache exists --- ci/before_cache.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/before_cache.sh b/ci/before_cache.sh index c86109168e..a25221e066 100755 --- a/ci/before_cache.sh +++ b/ci/before_cache.sh @@ -7,6 +7,8 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${CI_DIR}/common/build.sh" source "${CI_DIR}/common/suite.sh" +mkdir -p "${HOME}/.cache" + echo "before_cache.sh: cache size" du -chd 1 "${HOME}/.cache" | sort -rh | head -20 -- cgit From 2446b25c6b3bc945f29377e1d4fc01dd3622e06b Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 19 Feb 2022 20:11:11 -0500 Subject: ci: only cache third-party deps if they exist --- ci/before_cache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/before_cache.sh b/ci/before_cache.sh index a25221e066..bec6c37bbe 100755 --- a/ci/before_cache.sh +++ b/ci/before_cache.sh @@ -18,7 +18,7 @@ ccache -s 2>/dev/null || true find "${HOME}/.ccache" -name stats -delete # Update the third-party dependency cache only if the build was successful. -if ended_successfully; then +if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then # Do not cache downloads. They should not be needed with up-to-date deps. rm -rf "${DEPS_BUILD_DIR}/build/downloads" rm -rf "${CACHE_NVIM_DEPS_DIR}" -- cgit