-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure zstd is installed in all stages that could access GHA cache
- Loading branch information
Showing
4 changed files
with
71 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Install dependencies on Ubuntu | ||
|
||
description: Install needed dependencies, regardless if using GitHub- or self- hosted runners, container, sudo or not. | ||
|
||
inputs: | ||
dependencies: | ||
required: true | ||
type: string | ||
dependent_exes: | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install dependencies | ||
shell: bash --noprofile --norc -xeuo pipefail {0} | ||
run: | | ||
dependencies=(${{ inputs.dependencies }}) | ||
dependent_exes=(${{ inputs.dependent_exes }}) | ||
not_found=0 | ||
for dep in ${dependent_exes[@]}; do | ||
if ! (command -v $dep 2>&1 >/dev/null); then | ||
not_found=1 | ||
break | ||
fi | ||
done | ||
if [[ $not_found == 0 ]]; then | ||
echo "All dependencies are found. Do nothing." | ||
exit 0 | ||
fi | ||
if ! (command -v sudo 2>&1 >/dev/null); then | ||
if [[ $EUID == 0 ]]; then | ||
alias SUDO="" | ||
else | ||
echo "The following oprations require root access." | ||
exit 1 | ||
fi | ||
else | ||
alias SUDO="sudo" | ||
fi | ||
shopt -s expand_aliases | ||
SUDO apt update | ||
SUDO apt install -y ${dependencies[@]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters