Files
Krzysztof Cieślik dca80c7821
All checks were successful
CI / Build firmware (push) Successful in 38s
CI / Check formatting (push) Successful in 13s
CI / Static analysis (push) Successful in 12s
CI / Build documentation (push) Successful in 14s
Fix CI: use upload-artifact@v3, hardcode public Gitea hostname
upload-artifact@v4 is not supported on self-hosted Gitea (GHES).
Downgrade to v3 which works with Gitea Actions.

GITHUB_SERVER_URL resolves to the internal Docker address (http://gitea:3000)
instead of the public URL, making the gh-pages push URL malformed.
Hardcode gitea.archvium.eu as the push target.
2026-05-21 23:24:15 +02:00

116 lines
3.2 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build firmware
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- 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: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel . && ninja -C build
- name: Memory summary
run: |
echo '## Memory usage' >> "$GITHUB_STEP_SUMMARY"
echo '' >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
arm-none-eabi-size -A build/firmware \
| grep -E '^\.(text|data|bss|rodata|ARM)' \
>> "$GITHUB_STEP_SUMMARY"
echo '' >> "$GITHUB_STEP_SUMMARY"
arm-none-eabi-size build/firmware | tail -1 >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
- name: Upload firmware artifacts
uses: actions/upload-artifact@v3
with:
name: firmware-${{ github.sha }}
path: |
build/firmware.hex
build/firmware.map
if-no-files-found: error
format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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: |
find src include -name '*.c' -o -name '*.h' | \
xargs clang-format --dry-run --Werror --style=file:.clang-format
lint:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cppcheck
run: |
sudo apt-get update -q
sudo apt-get install -y --no-install-recommends cppcheck
- name: cppcheck
run: |
cppcheck --error-exitcode=1 \
--enable=warning,style,performance,portability \
--suppress=missingInclude \
--inline-suppr \
--std=c11 \
-I include \
src/
docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Doxygen
run: |
sudo apt-get update -q
sudo apt-get install -y --no-install-recommends doxygen
- name: Doxygen
run: |
doxygen Doxyfile 2>&1 | tee /tmp/doxy.log
! grep -q 'warning:' /tmp/doxy.log
- name: Deploy to gh-pages
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd docs/html
git init -b gh-pages
git config user.name "ci"
git config user.email "ci@localhost"
git add -A
git commit -m "docs: ${GITHUB_SHA}"
git push --force \
"https://x-token:${GITHUB_TOKEN}@gitea.archvium.eu/${GITHUB_REPOSITORY}.git" \
HEAD:gh-pages