Skip to content

Commit 7ff6f20

Browse files
committed
GHA: Install/upgrade git in containers
For the container we need to install git before the checkout actions. So add that to the list and move the setup before the checkout step.
1 parent 57dc7b8 commit 7ff6f20

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

.github/workflows/unit-tests.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,36 @@ jobs:
117117
shell: bash
118118

119119
steps:
120+
- name: Install system packages
121+
run: |
122+
if [[ "${{runner.os}}" =~ macOS ]]; then
123+
echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX"
124+
echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR"
125+
brew install cmake boost sdl2 sdl2_mixer gettext miniupnpc
126+
echo "Available Boost installs: $(ls "$HOMEBREW_CELLAR/boost/")"
127+
# Use the latest (last folder)
128+
BOOST_ROOT=$(find "$HOMEBREW_CELLAR/boost/"* -maxdepth 0 -type d | tail -n1)
129+
echo "Choosen Boost: $BOOST_ROOT"
130+
[[ -n "$BOOST_ROOT" ]] || exit 1
131+
ls "$BOOST_ROOT/include"
132+
echo "CMake config files:"
133+
find "$BOOST_ROOT"/lib/cmake -type f
134+
echo "BOOST_ROOT=${BOOST_ROOT}" >> $GITHUB_ENV
135+
else
136+
if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then
137+
apt-get -o Acquire::Retries=5 update
138+
apt-get -o Acquire::Retries=5 -y -q --no-install-suggests --no-install-recommends install sudo software-properties-common git
139+
fi
140+
compiler=${{matrix.compiler}}
141+
compiler=${compiler/gcc-/g++-}
142+
if [[ "${{matrix.init_llvm}}" == "true" ]]; then
143+
clang_version=${compiler#clang-*}
144+
wget -qO- "https://apt.llvm.org/llvm.sh" | sudo bash -s -- "${clang_version}"
145+
fi
146+
sudo apt-get -o Acquire::Retries=5 update
147+
sudo apt-get -o Acquire::Retries=5 -y -q --no-install-suggests --no-install-recommends install gettext libsdl2-dev libsdl2-mixer-dev libcurl4-openssl-dev libbz2-dev libminiupnpc-dev liblua5.2-dev $compiler
148+
fi
149+
120150
- name: Setup env and configure flags
121151
run: |
122152
echo "DEPS_DIR=${{runner.temp}}/.cache" >> $GITHUB_ENV
@@ -160,36 +190,6 @@ jobs:
160190
path: ${{env.DEPS_DIR}}
161191
key: ${{matrix.os}}-${{env.BOOST_VERSION}}
162192

163-
- name: Install system packages
164-
run: |
165-
if [[ "${{runner.os}}" =~ macOS ]]; then
166-
echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX"
167-
echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR"
168-
brew install cmake boost sdl2 sdl2_mixer gettext miniupnpc
169-
echo "Available Boost installs: $(ls "$HOMEBREW_CELLAR/boost/")"
170-
# Use the latest (last folder)
171-
BOOST_ROOT=$(find "$HOMEBREW_CELLAR/boost/"* -maxdepth 0 -type d | tail -n1)
172-
echo "Choosen Boost: $BOOST_ROOT"
173-
[[ -n "$BOOST_ROOT" ]] || exit 1
174-
ls "$BOOST_ROOT/include"
175-
echo "CMake config files:"
176-
find "$BOOST_ROOT"/lib/cmake -type f
177-
echo "BOOST_ROOT=${BOOST_ROOT}" >> $GITHUB_ENV
178-
else
179-
if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then
180-
apt-get -o Acquire::Retries=5 update
181-
apt-get -o Acquire::Retries=5 -y -q --no-install-suggests --no-install-recommends install sudo software-properties-common
182-
fi
183-
compiler=${{matrix.compiler}}
184-
compiler=${compiler/gcc-/g++-}
185-
if [[ "${{matrix.init_llvm}}" == "true" ]]; then
186-
clang_version=${compiler#clang-*}
187-
wget -qO- "https://apt.llvm.org/llvm.sh" | sudo bash -s -- "${clang_version}"
188-
fi
189-
sudo apt-get -o Acquire::Retries=5 update
190-
sudo apt-get -o Acquire::Retries=5 -y -q --no-install-suggests --no-install-recommends install gettext libsdl2-dev libsdl2-mixer-dev libcurl4-openssl-dev libbz2-dev libminiupnpc-dev liblua5.2-dev $compiler
191-
fi
192-
193193
- name: Setup CCache
194194
uses: hendrikmuhs/ccache-action@v1
195195
with:

0 commit comments

Comments
 (0)