Same reasoning as R8Forge: build the toolchain into the runner image once (R8Forge/ci/Dockerfile works for this repo too), and let the job only check it is present.
This commit is contained in:
1 parent
c170627ed9
commit
aafe105612
1 file changed
+10
-9
+10
-9
@@ -23,19 +23,20 @@ jobs:
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# The runner image is a bare ubuntu: no cmake, no compiler. Install the
|
||||
# toolchain the build needs (and print it, so the log shows what we got).
|
||||
# The image is expected to carry the toolchain already (ci/Dockerfile);
|
||||
# this step only proves it and says how to fix a bare image, instead of
|
||||
# failing later with "cmake: command not found".
|
||||
- name: toolchain
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
set -eu
|
||||
SUDO=""
|
||||
command -v sudo >/dev/null 2>&1 && SUDO=sudo
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq --no-install-recommends cmake g++ make
|
||||
for tool in cmake c++ make; do
|
||||
if ! command -v "$tool" >/dev/null 2>&1; then
|
||||
echo "this runner image has no $tool -- build ci/Dockerfile and point the runner label at it" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
cmake --version | head -1
|
||||
g++ --version | head -1
|
||||
c++ --version | head -1
|
||||
echo "cores: $(nproc)"
|
||||
- name: configure
|
||||
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
Reference in new issue
Block a user