aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.github/scripts/install_deps.sh27
-rw-r--r--.github/workflows/release.yml5
-rw-r--r--.github/workflows/test.yml4
3 files changed, 27 insertions, 9 deletions
diff --git a/.github/scripts/install_deps.sh b/.github/scripts/install_deps.sh
index 29f4d73a7f..bb99873267 100755
--- a/.github/scripts/install_deps.sh
+++ b/.github/scripts/install_deps.sh
@@ -1,10 +1,31 @@
#!/bin/bash
+SUDO="sudo"
+
+while (($# > 0)); do
+ case $1 in
+ --test) # install test dependencies
+ TEST=1
+ shift
+ ;;
+ --container) # don't use sudo
+ SUDO=""
+ shift
+ ;;
+ esac
+done
+
os=$(uname -s)
if [[ $os == Linux ]]; then
- sudo apt-get update
- sudo apt-get install -y build-essential cmake curl gettext locales-all ninja-build pkg-config unzip "$@"
+ $SUDO apt-get update
+ $SUDO apt-get install -y build-essential cmake curl gettext ninja-build pkg-config unzip
+ if [[ -n $TEST ]]; then
+ $SUDO apt-get install -y locales-all cpanminus
+ fi
elif [[ $os == Darwin ]]; then
brew update --quiet
- brew install ninja "$@"
+ brew install ninja
+ if [[ -n $TEST ]]; then
+ brew install cpanminus
+ fi
fi
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ebf5df7aac..a07e1a098a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -39,10 +39,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- - name: Install dependencies
- run: |
- apt-get update
- apt-get install -y build-essential cmake gettext ninja-build unzip
+ - run: ./.github/scripts/install_deps.sh --container
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: |
echo 'NVIM_BUILD_TYPE=Release' >> $GITHUB_ENV
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 5352d6a6d8..5249b36f9a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -41,7 +41,7 @@ jobs:
- name: Install dependencies
run: |
- ./.github/scripts/install_deps.sh lua-check
+ ./.github/scripts/install_deps.sh
brew install stylua uncrustify
- uses: ./.github/actions/cache
@@ -141,7 +141,7 @@ jobs:
run: mkdir -p "$LOG_DIR"
- name: Install dependencies
- run: ./.github/scripts/install_deps.sh cpanminus
+ run: ./.github/scripts/install_deps.sh --test
- name: Setup interpreter packages
run: |