From 1731ef31760ebf9574ff898a67c035bb4051b31f Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 16 Nov 2020 21:14:40 -0500 Subject: [PATCH 1/7] GHA: Rename linux workflow to CI --- .github/workflows/{linux.yml => ci.yml} | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{linux.yml => ci.yml} (100%) diff --git a/.github/workflows/linux.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/linux.yml rename to .github/workflows/ci.yml diff --git a/README.md b/README.md index bb83c26648..e2c82fa6e7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [Chat](https://gitter.im/neovim/neovim) | [Twitter](https://twitter.com/Neovim) -[![Linux CI](https://github.com/neovim/neovim/workflows/Linux%20CI/badge.svg)](https://github.com/neovim/neovim/actions?query=workflow%3A%22Linux+CI%22) +[![GitHub CI](https://github.com/neovim/neovim/workflows/CI/badge.svg)](https://github.com/neovim/neovim/actions?query=workflow%3A%22CI%22) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/urdqjrik5u521fac/branch/master?svg=true)](https://ci.appveyor.com/project/neovim/neovim/branch/master) [![Codecov coverage](https://img.shields.io/codecov/c/github/neovim/neovim.svg)](https://codecov.io/gh/neovim/neovim) [![Coverity Scan analysis](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227) From d93e397232ad93c106c143a720c256f96f0588e5 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 16 Nov 2020 21:26:47 -0500 Subject: [PATCH 2/7] ci: s/TRAVIS_OS_NAME/CI_OS_NAME/ for non-Travis-specific code --- .travis.yml | 1 + ci/common/build.sh | 2 +- ci/common/test.sh | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2f4603fa5c..b68f4f1bc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,7 @@ env: - CCACHE_COMPRESS=1 - CCACHE_SLOPPINESS=time_macros,file_macro - CCACHE_BASEDIR="$TRAVIS_BUILD_DIR" + - CI_OS_NAME="$TRAVIS_OS_NAME" anchors: envs: &common-job-env diff --git a/ci/common/build.sh b/ci/common/build.sh index f0bdec0a0e..0ee4b7493f 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -1,5 +1,5 @@ _stat() { - if test "${TRAVIS_OS_NAME}" = osx ; then + if test "${CI_OS_NAME}" = osx ; then stat -f %Sm "${@}" else stat -c %y "${@}" diff --git a/ci/common/test.sh b/ci/common/test.sh index 4ef6260339..118e181dfa 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -15,7 +15,7 @@ print_core() { return 0 fi echo "======= Core file $core =======" - if test "${TRAVIS_OS_NAME}" = osx ; then + if test "${CI_OS_NAME}" = osx ; then lldb -Q -o "bt all" -f "${app}" -c "${core}" else gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}" @@ -30,7 +30,7 @@ check_core_dumps() { fi local app="${1:-${BUILD_DIR}/bin/nvim}" local cores - if test "${TRAVIS_OS_NAME}" = osx ; then + if test "${CI_OS_NAME}" = osx ; then cores="$(find /cores/ -type f -print)" local _sudo='sudo' else From 0c022c03ee6177480abac92e80f6fd767500ed95 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 16 Nov 2020 21:28:01 -0500 Subject: [PATCH 3/7] GHA: Add macOS CI --- .github/workflows/ci.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8a8c01137..099f0b64d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,31 @@ -name: Linux CI +name: CI on: [push, pull_request] jobs: - linux: - name: ${{ matrix.flavor }} (cc=${{ matrix.cc }}) - runs-on: ubuntu-20.04 + build: + name: ${{ matrix.os }} ${{ matrix.flavor }} (cc=${{ matrix.cc }}) strategy: matrix: include: - flavor: asan cc: clang-11 + runner: ubuntu-20.04 + os: linux - flavor: lint cc: gcc + runner: ubuntu-20.04 + os: linux - flavor: tsan cc: clang-11 + runner: ubuntu-20.04 + os: linux + - cc: clang + runner: macos-10.15 + os: osx + runs-on: ${{ matrix.runner }} env: CC: ${{ matrix.cc }} + CI_OS_NAME: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -29,6 +39,7 @@ jobs: sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' - name: Install apt packages + 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 gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip From 36fe82ff98fe8b8e4658c7fd36f74bc87c869c4c Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 16 Nov 2020 21:32:05 -0500 Subject: [PATCH 4/7] env.sh: Handle no flavor being specified --- .github/workflows/env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/env.sh b/.github/workflows/env.sh index 84f26f949e..d038c4b607 100755 --- a/.github/workflows/env.sh +++ b/.github/workflows/env.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -u -FLAVOR=$1 +FLAVOR=${1:-} cat <> "$GITHUB_PATH" $HOME/.local/bin From 0d7777e9bcf483e161f01937a1000dfb57415b73 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 16 Nov 2020 21:57:46 -0500 Subject: [PATCH 5/7] GHA: brew required software --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 099f0b64d1..70cdc3b4a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,13 @@ jobs: if: matrix.flavor == 'asan' || matrix.flavor == 'tsan' run: sudo apt-get install -y clang-11 + - name: Install brew packages + if: matrix.os == 'osx' + run: | + brew update >/dev/null + brew install automake ccache cpanminus ninja + brew upgrade + - name: Setup interpreter packages run: | ./ci/before_install.sh From be9bd43502a4764dda987e552cee00a64370661a Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 16 Nov 2020 22:10:08 -0500 Subject: [PATCH 6/7] ci: Only setup ipv6 on macOS for Travis --- ci/before_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/before_script.sh b/ci/before_script.sh index 8bab1c4e17..701fe1d9eb 100755 --- a/ci/before_script.sh +++ b/ci/before_script.sh @@ -7,7 +7,7 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${CI_DIR}/common/build.sh" # Enable ipv6 on Travis. ref: a39c8b7ce30d -if ! test "${TRAVIS_OS_NAME}" = osx ; then +if test -n "${TRAVIS_OS_NAME}" && ! test "${TRAVIS_OS_NAME}" = osx ; then echo "before_script.sh: enable ipv6" sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 fi From 0bb565b13bcc7a199bf997a67b9a6039d584b84e Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 24 Nov 2020 16:50:05 -0500 Subject: [PATCH 7/7] GHA: Force CCACHE_DIR=$HOME/.ccache --- .github/workflows/env.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/env.sh b/.github/workflows/env.sh index d038c4b607..cc1cef5cc4 100755 --- a/.github/workflows/env.sh +++ b/.github/workflows/env.sh @@ -24,6 +24,7 @@ DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF FUNCTIONALTEST=functionaltest CCACHE_COMPRESS=1 CCACHE_SLOPPINESS=time_macros,file_macro +CCACHE_DIR=$HOME/.ccache EOF 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"