Factor out common environment setup GHA steps

This commit is contained in:
William S Fulton 2021-10-14 11:40:55 +01:00
commit d0b6cfeca4
3 changed files with 30 additions and 37 deletions

View file

@ -258,24 +258,7 @@ jobs:
- name: Configure
run: |
set -x
# Repeat language specific environment setup
case "$SWIGLANG" in
javascript)
case "$ENGINE" in
node)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
nvm use ${VER}
;;
*)
esac
;;
ruby)
source $HOME/.rvm/scripts/rvm
;;
esac
source Tools/CI-linux-environment.sh
if test -n '${{ matrix.CONFIGOPTS }}'; then
CONFIGOPTS=${{ matrix.CONFIGOPTS }}
@ -298,24 +281,7 @@ jobs:
working-directory: build/build
run: |
set -x
# Repeat language specific environment setup
case "$SWIGLANG" in
javascript)
case "$ENGINE" in
node)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
nvm use ${VER}
;;
*)
esac
;;
ruby)
source $HOME/.rvm/scripts/rvm
;;
esac
source Tools/CI-linux-environment.sh
if test -n "$CPP11"; then export CPPSTD=c++11; fi
if test -n "$CPP14"; then export CPPSTD=c++14; fi