ci: replace cmake script with bash script (#22246)

Bash has better error handling than cmake, and seem overall slightly
more suited to scripting than cmake.
This commit is contained in:
dundargoc 2023-02-13 18:26:01 +01:00 committed by GitHub
parent d359f7a533
commit 9de9bd4bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 35 deletions

View File

@ -1,27 +0,0 @@
cmake_minimum_required(VERSION 3.10)
if(APPLE)
execute_process(COMMAND brew update --quiet)
execute_process(COMMAND brew install automake ninja)
if(TEST_DEPS)
execute_process(COMMAND brew install cpanminus)
endif()
else()
# Assuming ubuntu for now. May expand if required.
set(PACKAGES
autoconf
automake
build-essential
curl
gettext
libtool-bin
locales-all
ninja-build
pkg-config
unzip)
execute_process(COMMAND sudo apt-get update)
execute_process(COMMAND sudo apt-get install -y ${PACKAGES})
if(TEST_DEPS)
execute_process(COMMAND sudo apt-get install -y cpanminus)
endif()
endif()

10
.github/scripts/install_deps.sh vendored Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
os=$(uname -s)
if [[ $os == Linux ]]; then
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake curl gettext libtool-bin locales-all ninja-build pkg-config unzip "$@"
elif [[ $os == Darwin ]]; then
brew update --quiet
brew install automake ninja "$@"
fi

View File

@ -41,9 +41,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
cmake -P ./.github/scripts/install_dependencies.cmake
sudo apt-get install -y lua-check
run: ./.github/scripts/install_deps.sh lua-check
- name: Cache uncrustify
id: cache-uncrustify
@ -132,7 +130,7 @@ jobs:
- name: Install dependencies
run: |
sudo add-apt-repository ppa:neovim-ppa/stable
cmake -P ./.github/scripts/install_dependencies.cmake
./.github/scripts/install_deps.sh
sudo apt-get install -y \
libluajit-5.1-dev \
libmsgpack-dev \
@ -225,7 +223,7 @@ jobs:
run: mkdir -p "$LOG_DIR"
- name: Install dependencies
run: cmake -D TEST_DEPS=ON -P ./.github/scripts/install_dependencies.cmake
run: ./.github/scripts/install_deps.sh cpanminus
- name: Setup interpreter packages
run: |
@ -364,7 +362,7 @@ jobs:
run: echo "$BIN_DIR" >> $GITHUB_PATH
- name: Install dependencies
run: cmake -P ./.github/scripts/install_dependencies.cmake
run: ./.github/scripts/install_deps.sh
- name: Install minimum required version of cmake
run: |

View File

@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v3
- name: Install dependencies
run: cmake -P ./.github/scripts/install_dependencies.cmake
run: ./.github/scripts/install_deps.sh
- name: Initialize CodeQL
uses: github/codeql-action/init@v2

View File

@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
run: cmake -P ./.github/scripts/install_dependencies.cmake
run: ./.github/scripts/install_deps.sh
- name: Download Coverity
run: |