mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
ci: enable CI_BUILD automatically if environment variable CI is true (#22312)
Having to specify CI_BUILD for every CI job requires boilerplate. More
importantly, it's easy to forget to enable CI_BUILD, as seen by
8a20f9f98a
. It's simpler to remember to
turn CI_BUILD off when a job errors instead of remembering that every
new job should have CI_BUILD on.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
env:
|
env:
|
||||||
CIRRUS_CLONE_DEPTH: '2'
|
CIRRUS_CLONE_DEPTH: '2'
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON
|
|
||||||
|
|
||||||
freebsd_task:
|
freebsd_task:
|
||||||
name: FreeBSD
|
name: FreeBSD
|
||||||
@@ -15,7 +14,7 @@ freebsd_task:
|
|||||||
build_deps_script:
|
build_deps_script:
|
||||||
- gmake deps
|
- gmake deps
|
||||||
build_script:
|
build_script:
|
||||||
- gmake CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
|
- gmake nvim
|
||||||
workaround_script:
|
workaround_script:
|
||||||
# Run tests as user "cirrus" instead of root. This is required for the
|
# Run tests as user "cirrus" instead of root. This is required for the
|
||||||
# permission-related tests to work correctly.
|
# permission-related tests to work correctly.
|
||||||
|
2
.github/scripts/build_universal_macos.sh
vendored
2
.github/scripts/build_universal_macos.sh
vendored
@@ -25,7 +25,7 @@ MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)"
|
|||||||
export MACOSX_DEPLOYMENT_TARGET
|
export MACOSX_DEPLOYMENT_TARGET
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64
|
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64
|
||||||
cmake --build .deps
|
cmake --build .deps
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64
|
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 -D CI_BUILD=OFF
|
||||||
cmake --build build
|
cmake --build build
|
||||||
cmake --install build --prefix build/release/nvim-macos
|
cmake --install build --prefix build/release/nvim-macos
|
||||||
cd build
|
cd build
|
||||||
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -67,7 +67,7 @@ jobs:
|
|||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: make CMAKE_FLAGS="-D CI_BUILD=ON -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX"
|
run: make CMAKE_FLAGS="-D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX"
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: make install
|
run: make install
|
||||||
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
- name: Build release
|
- name: Build release
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
CC=gcc-10 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="-DCI_BUILD=OFF -DCMAKE_INSTALL_PREFIX:PATH="
|
||||||
printf 'version<<END\n' >> $GITHUB_OUTPUT
|
printf 'version<<END\n' >> $GITHUB_OUTPUT
|
||||||
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT
|
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT
|
||||||
printf 'END\n' >> $GITHUB_OUTPUT
|
printf 'END\n' >> $GITHUB_OUTPUT
|
||||||
@@ -127,7 +127,7 @@ jobs:
|
|||||||
cmake --build .deps
|
cmake --build .deps
|
||||||
- name: build package
|
- name: build package
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo' -D CI_BUILD=OFF
|
||||||
cmake --build build --target package
|
cmake --build build --target package
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@@ -88,11 +88,13 @@ jobs:
|
|||||||
version: latest
|
version: latest
|
||||||
args: --check runtime/
|
args: --check runtime/
|
||||||
|
|
||||||
|
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||||
|
name: configure
|
||||||
|
run: cmake -B build -G Ninja -D CI_BUILD=OFF
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||||
name: luacheck
|
name: luacheck
|
||||||
run: |
|
run: cmake --build build --target lintlua-luacheck
|
||||||
cmake -B build -G Ninja
|
|
||||||
cmake --build build --target lintlua-luacheck
|
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||||
name: lintsh
|
name: lintsh
|
||||||
@@ -198,7 +200,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -G Ninja -D CI_BUILD=ON -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.flags }}
|
cmake -B build -G Ninja -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.flags }}
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
- if: "!cancelled()"
|
- if: "!cancelled()"
|
||||||
@@ -318,7 +320,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo' -D CI_BUILD=ON
|
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo'
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
- name: Install test deps
|
- name: Install test deps
|
||||||
|
@@ -26,7 +26,7 @@ APP_DIR="$APP.AppDir"
|
|||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
# Build and install nvim into the AppImage
|
# Build and install nvim into the AppImage
|
||||||
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr -DCMAKE_INSTALL_MANDIR=man"
|
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCI_BUILD=OFF -DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr -DCMAKE_INSTALL_MANDIR=man"
|
||||||
make install
|
make install
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@@ -170,7 +170,11 @@ if(HAS_DIAG_COLOR_FLAG)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(CI_BUILD "CI, extra flags will be set" OFF)
|
if($ENV{CI})
|
||||||
|
option(CI_BUILD "CI, extra flags will be set" ON)
|
||||||
|
else()
|
||||||
|
option(CI_BUILD "CI, extra flags will be set" OFF)
|
||||||
|
endif()
|
||||||
if(CI_BUILD)
|
if(CI_BUILD)
|
||||||
message(STATUS "CI build enabled")
|
message(STATUS "CI build enabled")
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
Reference in New Issue
Block a user