Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 74 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Checks that need no copy of the car's system: style, repository content, PC tests.
# The SDK job builds ARM with link-only stubs; car-library validation remains a developer's task.
# CI compiles ARM and checks link-only SDK outputs; car-library validation remains outside CI.
name: CI

on:
Expand All @@ -20,11 +19,14 @@ jobs:
runs-on: ubuntu-24.04
container: debian:12
timeout-minutes: 20
env:
CCACHE_MAXSIZE: 150M
HOST_CACHE: ccache
steps:
- name: Install the tools
run: |
apt-get update
apt-get install -y --no-install-recommends ca-certificates dbus g++ gcc git libdbus-1-dev libssl-dev make \
apt-get install -y --no-install-recommends ca-certificates ccache dbus g++ gcc git libdbus-1-dev libssl-dev make \
pkg-config protobuf-compiler python3 python3-protobuf python3-venv shellcheck
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -33,24 +35,90 @@ jobs:
run: |
python3 -m venv /opt/style
/opt/style/bin/pip install --quiet --constraint requirements-dev.txt clang-format ruff
- name: Restore host compiler cache
id: host-cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .ccache
key: ccache-debian12-${{ runner.arch }}-normal-${{ hashFiles('Makefile', 'tests/host.mk') }}-${{ github.sha }}
restore-keys: ccache-debian12-${{ runner.arch }}-normal-${{ hashFiles('Makefile', 'tests/host.mk') }}-
- name: Style, content and PC tests
id: host-tests
run: |
git config --global --add safe.directory "$PWD"
make check STYLE_TOOLS=/opt/style/bin
export CCACHE_DIR="$PWD/.ccache"
ccache --zero-stats
make -j"$(nproc)" --output-sync=target check STYLE_TOOLS=/opt/style/bin
- name: Host compiler cache statistics
if: always() && steps.host-tests.outcome != 'skipped'
run: CCACHE_DIR="$PWD/.ccache" ccache --show-stats
- name: Save host compiler cache
if: github.event_name == 'push' && steps.host-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .ccache
key: ${{ steps.host-cache.outputs.cache-primary-key }}

sanitizers:
name: PC sanitizers (ASan, UBSan, leaks)
runs-on: ubuntu-24.04
container: debian:12
timeout-minutes: 15
env:
CCACHE_MAXSIZE: 150M
HOST_CACHE: ccache
steps:
- name: Install the tools
run: |
apt-get update
apt-get install -y --no-install-recommends ca-certificates g++ git libssl-dev make
apt-get install -y --no-install-recommends ca-certificates ccache g++ git libssl-dev make
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Restore sanitizer compiler cache
id: sanitizer-cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .ccache
key: ccache-debian12-${{ runner.arch }}-sanitized-${{ hashFiles('Makefile', 'tests/host.mk') }}-${{ github.sha }}
restore-keys: ccache-debian12-${{ runner.arch }}-sanitized-${{ hashFiles('Makefile', 'tests/host.mk') }}-
- name: PC tests with ASan, UBSan and LSan
run: make -j2 test-host-sanitizers
id: sanitizer-tests
run: |
export CCACHE_DIR="$PWD/.ccache"
ccache --zero-stats
make -j"$(nproc)" --output-sync=target test-host-sanitizers
- name: Sanitizer compiler cache statistics
if: always() && steps.sanitizer-tests.outcome != 'skipped'
run: CCACHE_DIR="$PWD/.ccache" ccache --show-stats
- name: Save sanitizer compiler cache
if: github.event_name == 'push' && steps.sanitizer-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .ccache
key: ${{ steps.sanitizer-cache.outputs.cache-primary-key }}

arm-compile:
name: ARM compile (GCC 4.7)
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Build the public ARM toolchain
run: docker build -t entrynav2-tc:4.7 toolchain
- name: Compile ARM objects without the car sysroot
run: |
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/work" entrynav2-tc:4.7 sh -exc '
arm-linux-gnueabihf-g++ --version
test "$(arm-linux-gnueabihf-g++ -dumpmachine)" = arm-linux-gnueabihf
version=$(dpkg-query -W -f="\${Version}" g++-4.7-arm-linux-gnueabihf)
case "$version" in
4.7.2-*) ;;
*) echo "Unexpected ARM compiler package version: $version" >&2; exit 1 ;;
esac
make -j"$(getconf _NPROCESSORS_ONLN)" compile-arm
arm-linux-gnueabihf-objdump -f platform/main.o tools/aa_supervisor.o hmiapp/entry_aa_app.o
'

arm-sdk:
name: ARM link-only SDK
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ __pycache__/
!/tests/*.c
!/tests/*.cpp
!/tests/*.hpp
!/tests/host.mk
!/tests/*.py
!/tests/fixtures/

Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,17 @@ fermeture.
|---|---|---|
| PC, comme la CI | `make check` | `g++`, `libssl-dev`, `libdbus-1-dev`, `protobuf-compiler`, `python3-protobuf`, clang-format 18.1.8 et ruff 0.6.9 (`pip install -r requirements-dev.txt`) |
| PC, mémoire et UB | `make test-host-sanitizers` | `g++` avec ASan/UBSan, `libssl-dev` ; tests des trames et de la session, détection des fuites active |
| ARM compile-only (CI) | `make compile-arm` inside `entrynav2-tc:4.7` | Docker and the image's public headers; no copy of the head unit system |
| ARM | `bash toolchain/tc.sh make -j4 all hmiapp test-arm-all` | Docker, la copie du système de la voiture |
| ARM SDK, hors publication | `bash toolchain/tc.sh --sdk make -j4 all` puis `python3 tools/verify_sdk.py` | Images Docker `entrynav2-tc:4.7` et `entrynav2-sdk:4.7` ([README](README.md#building-from-source)), `pyelftools`, `readelf` ; pas de copie du système |
| ARM sous QEMU | `python3 -I tests/run_qemu.py` | `qemu-user`, la copie du système |
| Programmes validés | `make verify_binary verify_wireless` | idem |
| Procédure d'installation | les commandes de [docs/INSTALLATION.md](docs/INSTALLATION.md), avec la BusyBox de la voiture sous QEMU | idem |

Host tests support `make -jN`. Normal and sanitized binaries are kept in `tests/build-host/normal/` and
`tests/build-host/sanitized/`, respectively. `HOST_CACHE=ccache` is optional for local builds. The ARM compile-only
check uses GCC 4.7 but does not replace linking against the head unit libraries or testing under QEMU.

Les résultats SDK sont isolés dans `artifacts/sdk/` : ils ne passent pas par la publication. Le contrôle ELF ne
remplace ni le chargement avec les bibliothèques de la voiture ni l'essai en voiture. Si la compilation de référence
est disponible, `python3 tools/verify_sdk.py --compare-reference` compare aussi leurs contrats ELF.
Expand Down
Loading
Loading