Skip to content

Commit

Permalink
Merge branch 'libcsp-develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Apaisal committed Aug 23, 2024
2 parents 0b39eaa + 4e8d79c commit c2f83ad
Show file tree
Hide file tree
Showing 52 changed files with 636 additions and 247 deletions.
76 changes: 76 additions & 0 deletions .github/ISSUE_TEMPLATE/01_q_and_a.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
name: Q & A
about: Ask for help
title: ''
labels: Q&A
---

## Description

<!--
Describe your question in detail. Explain what you're trying to
achieve and what specific part is causing trouble.
-->

## Steps to Reproduce

<!--
Provide a step-by-step guide on how to reproduce the issue. Include
any code snippets, commands, or configurations.
-->

1.
2.
3.

## Expected behavior

<!--
A clear and concise description of what you expected to happen.
-->

## Actual Behavior

<!--
Describe what actually happened. Include any error messages or
unexpected outputs.
-->

## Environment Details

Provide information about your environment, including:

- Build OS: (e.g., Ubuntu 24.04)
- Target OS: (e.g., Ubunut 24.04, FreeRTOS, Zephyr)
- libcsp commit hash:
- Meson version:
- CMake version:
- GNU Make version
- Ninja version:

## Logs or console output from the very beginning to the end

<!--
Do NOT add screen shorts. Make sure to copy & paste in plain text. Or,
use logging feature of your terminal software.
-->

## Additional Context

<!--
Add any other context, logs, or screenshots that might help in
understanding the issue.
-->

## Checklist

<!--
Please confirm by replacing `[ ]` with `[x]`.
-->

- [ ] I've searched in "Issues" for similar issues, both open and closed.
- [ ] I've used GitHub Flavored Markdown (GFM) to format my text.
- [ ] I've avoided using screenshots for console output or logs
- [ ] I've included all relevant details and steps to reproduce the issue.
- [ ] I've provided information about my environment.
- [ ] I've attached necessary logs or code snippet for minimal reproducible example.
78 changes: 78 additions & 0 deletions .github/ISSUE_TEMPLATE/02_bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: Bug Report
about: Create a report to help us improve libcsp
title: ''
labels: Defect
---

## Description

<!--
Describe the bug in detail. Explain what the bug is and how it affects
the project.
-->

## Steps to Reproduce

<!--
Provide a step-by-step guide on how to reproduce the issue. Include
any code snippets, commands, or configurations.
-->

1.
2.
3.

## Expected behavior

<!--
A clear and concise description of what you expected to happen.
-->

## Actual Behavior:

<!--
Describe what actually happened. Include any error messages or
unexpected outputs.
-->

## Environment Details:

Provide information about your environment, including:

- Build OS: (e.g., Ubuntu 24.04)
- Target OS: (e.g., Ubunut 24.04, FreeRTOS, Zephyr)
- libcsp commit hash:
- Meson version:
- CMake version:
- GNU Make version
- Ninja version:

## Logs or console output from the very beginning to the end

<!--
Do NOT add screen shorts. Make sure to copy & paste in plain text. Or,
use logging feature of your terminal software.
-->

## Additional Context:

<!--
Add any other context, logs or code snippet for minimal reproducible
example that might help in understanding the issue.
-->

## Checklist

<!--
Please confirm by replacing `[ ]` with `[x]`.
-->

- [ ] I've searched in "Issues" for similar issues, both open and closed.
- [ ] I've used GitHub Flavored Markdown (GFM) to format my text.
- [ ] I've avoided using screenshots for console output or logs
- [ ] I've included all relevant details and steps to reproduce the issue.
- [ ] I've provided information about my environment.
- [ ] I've attached necessary logs or code snippet for minimal reproducible example.
58 changes: 58 additions & 0 deletions .github/workflows/abi-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: ABI Compliance Check
on: [pull_request]
jobs:
abi-check:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Setup packages on Linux
run: |
sudo apt-get update
sudo apt-get install libzmq3-dev libsocketcan-dev
- name: Setup build system packages on Linux
run: |
sudo apt-get install ninja-build cmake
- name: Setup ABI Compliance Checker
run: |
sudo apt-get install abi-compliance-checker abi-dumper
- name: Checkout merged-base
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: Build and Dump ABI for `merged-base` version
run: |
cmake -GNinja -B build -DCMAKE_BUILD_TYPE=Debug -DCSP_USE_RTABLE=1 -DCMAKE_POSITION_INDEPENDENT_CODE=ON && ninja -C build
abi-dumper build/libcsp.so -lver "merged-base" -o ../tmp/libcsp-merged-base.dump
- name: Checkout Current PR
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Build and Dump ABI for Current PR
run: |
cmake -GNinja -B build -DCMAKE_BUILD_TYPE=Debug -DCSP_USE_RTABLE=1 -DCMAKE_POSITION_INDEPENDENT_CODE=ON && ninja -C build
abi-dumper build/libcsp.so -lver "PR" -o ../tmp/pr.dump
- name: Compare ABI
run: |
abi-compliance-checker -l libcsp -old ../tmp/libcsp-merged-base.dump -new ../tmp/pr.dump
- name: Check ABI Compatibility Result
if: failure()
run: echo "::warning::ABI compatibility issues detected. Please review the report."

- name: Upload ABI Report
if: always()
uses: actions/upload-artifact@v4
with:
name: abi-compliance-report-${{ github.run_id }}
path: compat_reports
if-no-files-found: warn
64 changes: 64 additions & 0 deletions .github/workflows/build-test-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Python Bindings
on: [push, pull_request]
jobs:
build-test-python:
strategy:
fail-fast: false
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
buildsystem:
- meson
- cmake
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup packages on Linux
run: |
sudo apt-get update
sudo apt-get install libzmq3-dev libsocketcan-dev
- name: Setup build system packages on Linux
run: |
sudo apt-get install ninja-build ${{ matrix.buildsystem }}
- name: Checkout
uses: actions/checkout@v4

- name: Build libcsp examples
run: python3 examples/buildall.py --build-system=${{ matrix.buildsystem }}

- name: Build libcsp with python binding with cmake
if: ${{ matrix.buildsystem == 'cmake' }}
run: |
cmake -GNinja -B builddir -DCSP_ENABLE_PYTHON3_BINDINGS=1 -DCSP_USE_RTABLE=1 && ninja -C builddir
- name: Install the latest Meson using Pip if Python is 3.12 or later
# Meson 1.3+ supports Python 3.12 (distutils removed)
if: ${{ matrix.buildsystem == 'meson' && matrix.python-version == '3.12' }}
run: |
pip install meson
meson --version
- name: Build libcsp with python binding with meson
if: ${{ matrix.buildsystem == 'meson' }}
run: |
meson setup builddir -Denable_python3_bindings=true -Duse_rtable=true && ninja -C builddir
- name: Run ZMQ Python binding Test
run: |
build/examples/zmqproxy &
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -z localhost -s 27 -a 2
pkill zmqproxy
6 changes: 2 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
#- macos-latest
arch:
- posix
buildsystem:
- meson
- cmake
Expand Down Expand Up @@ -47,7 +45,7 @@ jobs:
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
run: python3 ./examples/buildall.py ${{ matrix.arch }} --build-system=${{ matrix.buildsystem }}
run: python3 ./examples/buildall.py --build-system=${{ matrix.buildsystem }}

- name: Run Loopback Test
run: |
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/gitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: GitLint

on:
pull_request

jobs:
gitlint:
runs-on: ubuntu-latest
name: Run gitlint against all commits in a PR
steps:

- name: Install python dependencies
run: |
pip3 install gitlint
- name: Checkout the code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Setup Git (pull request)
run: |
git checkout -b this_pr
- name: Run gitlint
if: ${{ github.base_ref }}
env:
BASE_REF: ${{ github.base_ref }}
run: |
gitlint --commits origin/${BASE_REF}..this_pr
15 changes: 15 additions & 0 deletions .github/workflows/linelint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: EOF newline

on:
pull_request

jobs:
linelint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Linelint
uses: fernandrone/linelint@master
19 changes: 19 additions & 0 deletions .linelint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 'true' will fix files
autofix: false

# list of paths to ignore, uses gitignore syntaxes (executes before any rule)
ignore:
- /.git
- /zephyr

rules:
# checks if file ends in a newline character
end-of-file:
# set to true to enable this rule
enable: true

# set to true to disable autofix (if enabled globally)
disable-autofix: true

# if true also checks if file ends in a single newline character
single-new-line: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The latest version of the /doc folder is compiled to HTML and hosted on:
Thank you for considering contributing to libcsp! We welcome
contributions from the community to help improve and grow the
project. Please take a moment to review our
[guidelines](./doc/git-commit.md) before opening a Pull Request!
[guidelines](./doc/contributing.md) before opening a Pull Request!

## Software license

Expand Down
1 change: 0 additions & 1 deletion contrib/drivers/can/csp_driver_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,3 @@ csp_iface_t * csp_driver_can_init(int addr, int netmask, int id, can_mode_e mode
return &mcan[id].interface;

}

1 change: 0 additions & 1 deletion contrib/hooks/csp_hook_asf4.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ void csp_reboot_hook(void) {
void csp_shutdown_hook(void) {
NVIC_SystemReset();
}

Loading

0 comments on commit c2f83ad

Please sign in to comment.