TirSystem/github-action: Publish wiki / publish-wiki (push) Skipped
TirSystem/github-action: Sync GitHub mirror metadata / sync-metadata (push) Skipped
Runner tools trial / probe (push) Successful in 1m53s
58 lines
2.3 KiB
YAML
58 lines
2.3 KiB
YAML
name: Runner tools trial
|
|
|
|
# Throwaway (MIL-007 task 2): which C++ and C# tools the runner has or can install.
|
|
on:
|
|
push:
|
|
branches: [ verify-runner-tools ]
|
|
|
|
jobs:
|
|
probe:
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Report the image and the tools it has
|
|
run: |
|
|
set +e
|
|
echo "== image"; cat /etc/os-release | head -3; id -u; uname -m
|
|
echo "== tools present"
|
|
for t in clang-format clang-tidy cppcheck dotnet gcc g++ cmake make python3 pip3 curl sudo; do
|
|
if command -v "$t" >/dev/null 2>&1; then echo "HAS $t: $("$t" --version 2>&1 | head -1)"; else echo "MISSING $t"; fi
|
|
done
|
|
|
|
- name: Install from PyPI
|
|
run: |
|
|
set +e
|
|
python3 -m venv /tmp/v
|
|
for pkg in clang-format clang-tidy cppcheck-wheel cmakelang; do
|
|
s=$(date +%s)
|
|
if /tmp/v/bin/pip install --quiet "$pkg" 2>/tmp/err; then echo "PIP OK $pkg in $(( $(date +%s) - s ))s"; else echo "PIP FAIL $pkg: $(tail -1 /tmp/err)"; fi
|
|
done
|
|
/tmp/v/bin/clang-format --version 2>&1 | head -1
|
|
/tmp/v/bin/clang-tidy --version 2>&1 | head -2
|
|
|
|
- name: Install with apt
|
|
run: |
|
|
set +e
|
|
s=$(date +%s)
|
|
if [ "$(id -u)" = 0 ]; then SUDO=""; else SUDO="sudo"; fi
|
|
$SUDO apt-get update -qq 2>&1 | tail -2
|
|
for pkg in cppcheck clang-format clang-tidy dotnet-sdk-8.0; do
|
|
s=$(date +%s)
|
|
if $SUDO apt-get install -y -qq "$pkg" >/tmp/apt.log 2>&1; then echo "APT OK $pkg in $(( $(date +%s) - s ))s"; else echo "APT FAIL $pkg: $(tail -1 /tmp/apt.log)"; fi
|
|
done
|
|
command -v cppcheck && cppcheck --version
|
|
command -v clang-format && clang-format --version
|
|
command -v dotnet && dotnet --version
|
|
|
|
- name: Install the .NET SDK with the official script
|
|
run: |
|
|
set +e
|
|
s=$(date +%s)
|
|
if curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh; then
|
|
bash /tmp/dotnet-install.sh --channel 8.0 --install-dir /tmp/dotnet >/tmp/dn.log 2>&1 && echo "DOTNET OK in $(( $(date +%s) - s ))s" || { echo "DOTNET FAIL"; tail -3 /tmp/dn.log; }
|
|
/tmp/dotnet/dotnet --version
|
|
else
|
|
echo "DOTNET script download failed"
|
|
fi
|