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