Fix CI: install tools natively instead of using Docker-in-Docker
Some checks failed
CI / Build firmware (push) Successful in 37s
CI / Check formatting (push) Successful in 14s
CI / Static analysis (push) Failing after 12s
CI / Build documentation (push) Failing after 13s

Volume mounts with -v $PWD:/src fail when the runner itself runs
inside a container (the path exists in the runner container but not
on the Docker daemon host). Switch all four jobs to native apt-get
installs of the same packages that are in the Dockerfile. The
container-based just recipes remain unchanged for local use.
This commit is contained in:
Krzysztof Cieślik
2026-05-21 23:12:14 +02:00
parent 39a89036cc
commit ee7e5544bb

View File

@@ -6,9 +6,6 @@ on:
pull_request:
branches: [main]
env:
IMAGE: ptt-builder
jobs:
build:
name: Build firmware
@@ -18,25 +15,18 @@ jobs:
with:
submodules: recursive
- name: Build container image
run: docker build -t $IMAGE .
- name: Install toolchain
run: |
sudo apt-get update -q
sudo apt-get install -y --no-install-recommends \
gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi \
cmake ninja-build
- name: Compile firmware
run: |
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "$PWD:/src" \
$IMAGE \
sh -c "cmake -B /src/build -G Ninja \
-DCMAKE_BUILD_TYPE=MinSizeRel /src \
&& ninja -C /src/build"
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel . && ninja -C build
- name: Print size
run: |
docker run --rm \
-v "$PWD:/src" \
$IMAGE \
arm-none-eabi-size /src/build/firmware
run: arm-none-eabi-size build/firmware
format:
name: Check formatting
@@ -44,18 +34,15 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build container image
run: docker build -t $IMAGE .
- name: Install clang-format
run: |
sudo apt-get update -q
sudo apt-get install -y --no-install-recommends clang-format
- name: clang-format check
run: |
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "$PWD:/src" \
$IMAGE \
sh -c "find /src/src /src/include -name '*.c' -o -name '*.h' | \
xargs clang-format --dry-run --Werror \
--style=file:/src/.clang-format"
find src include -name '*.c' -o -name '*.h' | \
xargs clang-format --dry-run --Werror --style=file:.clang-format
lint:
name: Static analysis
@@ -63,22 +50,20 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build container image
run: docker build -t $IMAGE .
- name: Install cppcheck
run: |
sudo apt-get update -q
sudo apt-get install -y --no-install-recommends cppcheck
- name: cppcheck
run: |
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "$PWD:/src" \
$IMAGE \
sh -c "cppcheck --error-exitcode=1 \
--enable=warning,style,performance,portability \
--suppress=missingInclude \
--inline-suppr \
--std=c11 \
-I /src/include \
/src/src/"
cppcheck --error-exitcode=1 \
--enable=warning,style,performance,portability \
--suppress=missingInclude \
--inline-suppr \
--std=c11 \
-I include \
src/
docs:
name: Build documentation
@@ -86,14 +71,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build container image
run: docker build -t $IMAGE .
- name: Install Doxygen
run: |
sudo apt-get update -q
sudo apt-get install -y --no-install-recommends doxygen
- name: Doxygen
run: |
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "$PWD:/src" \
$IMAGE \
sh -c "cd /src && doxygen Doxyfile 2>&1 | tee /tmp/doxy.log && \
! grep -q 'warning:' /tmp/doxy.log"
doxygen Doxyfile 2>&1 | tee /tmp/doxy.log
! grep -q 'warning:' /tmp/doxy.log