From 5c52971f603d35aa689022eb0a0bc670ab6788e6 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Mon, 5 Dec 2022 11:58:13 +0100 Subject: [PATCH] ci: use shell script to deduplicate workflow (#21079) --- .github/scripts/install_deps_ubuntu.sh | 19 ++++++++++++++++ .github/workflows/ci.yml | 31 +++++--------------------- .github/workflows/codeql.yml | 4 +--- 3 files changed, 25 insertions(+), 29 deletions(-) create mode 100755 .github/scripts/install_deps_ubuntu.sh diff --git a/.github/scripts/install_deps_ubuntu.sh b/.github/scripts/install_deps_ubuntu.sh new file mode 100755 index 0000000000..012409ba4a --- /dev/null +++ b/.github/scripts/install_deps_ubuntu.sh @@ -0,0 +1,19 @@ +#!/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 00ba55d578..423760fc79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,18 +31,8 @@ jobs: - name: Install apt packages run: | - sudo apt-get update - sudo apt-get install -y \ - autoconf \ - automake \ - build-essential \ - cmake \ - gettext \ - libtool-bin \ - locales \ - lua-check \ - ninja-build \ - pkg-config + ./.github/scripts/install_deps_ubuntu.sh + sudo apt-get install -y lua-check - name: Cache uncrustify id: cache-uncrustify @@ -136,31 +126,22 @@ jobs: - name: Install apt packages run: | sudo add-apt-repository ppa:neovim-ppa/stable - sudo apt-get update + ./.github/scripts/install_deps_ubuntu.sh sudo apt-get install -y \ - autoconf \ - automake \ - build-essential \ - cmake \ - gettext \ libluajit-5.1-dev \ libmsgpack-dev \ libtermkey-dev \ - libtool-bin \ libtree-sitter-dev \ libunibilium-dev \ libuv1-dev \ libvterm-dev \ - locales \ lua-busted \ lua-filesystem \ lua-inspect \ lua-lpeg \ lua-luv-dev \ lua-nvim \ - luajit \ - ninja-build \ - pkg-config + luajit - uses: ./.github/actions/cache @@ -232,9 +213,7 @@ jobs: - name: Install apt packages if: matrix.os == 'linux' - run: | - sudo apt-get update - sudo apt-get install -y autoconf automake build-essential cmake cpanminus gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip + run: ./.github/scripts/install_deps_ubuntu.sh - name: Install minimum required version of cmake if: matrix.cmake == 'minimum_required' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6ba0d43fe0..a11a87f93a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -26,9 +26,7 @@ jobs: run: ./.github/workflows/env.sh - name: Install apt packages - run: | - sudo apt-get update - sudo apt-get install -y autoconf automake build-essential cmake cpanminus gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip + run: ./.github/scripts/install_deps_ubuntu.sh - name: Initialize CodeQL uses: github/codeql-action/init@v2