aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-02-12 22:09:10 +0100
committerGitHub <noreply@github.com>2023-02-12 22:09:10 +0100
commit5d3769ea2343a30c60963011bef85346320bd97c (patch)
tree7cbdecd8195dba423391d81f2efbf2021fd04434
parent5f72ab77bff1f1224be5cbbf9423bdddbc25635c (diff)
downloadrneovim-5d3769ea2343a30c60963011bef85346320bd97c.tar.gz
rneovim-5d3769ea2343a30c60963011bef85346320bd97c.tar.bz2
rneovim-5d3769ea2343a30c60963011bef85346320bd97c.zip
ci: install dependencies with a single script (#22241)
It's easier if the os-specific installations are done by the script itself
-rw-r--r--.github/scripts/install_dependencies.cmake27
-rwxr-xr-x.github/scripts/install_deps_ubuntu.sh19
-rw-r--r--.github/workflows/ci.yml23
-rw-r--r--.github/workflows/codeql.yml4
-rw-r--r--.github/workflows/coverity.yml4
5 files changed, 38 insertions, 39 deletions
diff --git a/.github/scripts/install_dependencies.cmake b/.github/scripts/install_dependencies.cmake
new file mode 100644
index 0000000000..c2299614c0
--- /dev/null
+++ b/.github/scripts/install_dependencies.cmake
@@ -0,0 +1,27 @@
+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()
diff --git a/.github/scripts/install_deps_ubuntu.sh b/.github/scripts/install_deps_ubuntu.sh
deleted file mode 100755
index 012409ba4a..0000000000
--- a/.github/scripts/install_deps_ubuntu.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-PACKAGES=(
- autoconf
- automake
- build-essential
- cmake
- cpanminus
- curl
- gettext
- libtool-bin
- locales-all
- ninja-build
- pkg-config
- unzip
-)
-
-sudo apt-get update
-sudo apt-get install -y "${PACKAGES[@]}"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f49b54216d..717362963c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -40,9 +40,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- - name: Install apt packages
+ - name: Install dependencies
run: |
- ./.github/scripts/install_deps_ubuntu.sh
+ cmake -P ./.github/scripts/install_dependencies.cmake
sudo apt-get install -y lua-check
- name: Cache uncrustify
@@ -129,10 +129,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- - name: Install apt packages
+ - name: Install dependencies
run: |
sudo add-apt-repository ppa:neovim-ppa/stable
- ./.github/scripts/install_deps_ubuntu.sh
+ cmake -P ./.github/scripts/install_dependencies.cmake
sudo apt-get install -y \
libluajit-5.1-dev \
libmsgpack-dev \
@@ -224,15 +224,8 @@ jobs:
- name: Create log dir
run: mkdir -p "$LOG_DIR"
- - name: Install apt packages
- if: runner.os == 'Linux'
- run: ./.github/scripts/install_deps_ubuntu.sh
-
- - name: Install brew packages
- if: runner.os == 'macOS'
- run: |
- brew update --quiet
- brew install automake cpanminus ninja
+ - name: Install dependencies
+ run: cmake -D TEST_DEPS=ON -P ./.github/scripts/install_dependencies.cmake
- name: Setup interpreter packages
run: |
@@ -370,8 +363,8 @@ jobs:
- name: Set up environment
run: echo "$BIN_DIR" >> $GITHUB_PATH
- - name: Install apt packages
- run: ./.github/scripts/install_deps_ubuntu.sh
+ - name: Install dependencies
+ run: cmake -P ./.github/scripts/install_dependencies.cmake
- name: Install minimum required version of cmake
run: |
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 657ace20fd..c4f4346de1 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -17,8 +17,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- - name: Install apt packages
- run: ./.github/scripts/install_deps_ubuntu.sh
+ - name: Install dependencies
+ run: cmake -P ./.github/scripts/install_dependencies.cmake
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index 87e2cb1453..15c494dc93 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -11,9 +11,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
+ run: cmake -P ./.github/scripts/install_dependencies.cmake
- name: Download Coverity
run: |