Skip to content

Commit 80d425f

Browse files
Initial commit
0 parents  commit 80d425f

20 files changed

+633
-0
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This is a # Default codeowners for the repository
2+
* @SiliconLabsSoftware/devservices-admins

.github/CONTRIBUTING.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Contributing Guideline
2+
As an open-source project, we welcome and encourage the community to submit patches directly to the project.
3+
In our collaborative open-source environment, standards and methods for submitting changes help reduce
4+
the chaos that can result from an active development community.
5+
6+
This document explains how to participate in project conversations, log bugs and enhancement requests,
7+
and submit patches to the project so your patch will be accepted quickly into the codebase.
8+
9+
## Prerequisites
10+
You should be familiar with Git and GitHub. [Getting started](https://docs.github.com/en/get-started)
11+
If you haven't already done so, you'll need to create a (free) GitHub account at https://github.com
12+
and have Git tools available on your development system. You also need to add your email address to your account.
13+
14+
As a contributor, you'll want to be familiar with the Silicon Labs tooling:
15+
- [Simplicity Studio](https://docs.silabs.com/simplicity-studio-5-users-guide/latest/ss-5-users-guide-overview/)
16+
- [Platform](https://docs.silabs.com/gecko-platform/latest/platform-overview/)
17+
- [Simplicity Commander](https://docs.silabs.com/simplicity-commander/latest/simplicity-commander-start/)
18+
19+
Read the Silicon Labs [coding guidelines](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/coding_standard.md).
20+
## Git Setup
21+
We need to know who you are, and how to contact you. Please ass the following information to your Git installation:
22+
```
23+
git config --global user.name "FirstName LastName"
24+
git config --global user.email "[email protected]"
25+
```
26+
set the Git configuration variables user.name to your full name, and user.email to your email address.
27+
The user.name must be your full name (first and last at minimum), not a pseudonym or hacker handle.
28+
The email address that you use in your Git configuration must match the email address you use to sign your commits.
29+
30+
If you intend to edit commits using the Github.com UI, ensure that your github profile email address and profile name also match those used in your git configuration
31+
(user.name & user.email).
32+
33+
### Set up GitHub commit signature
34+
35+
**command line setup**
36+
37+
The repository requires signed off commits. Follow this [guide](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) how to set it up.
38+
1. Generate a gpg key [howto](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key)
39+
2. Configure your local repository with the gpg key. [guide]whttps://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key)
40+
3. Configure your GitHub account with the gpg key [guide](https://docs.github.com/en/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key)
41+
42+
**Command line steps:**
43+
Use the git-bash and navigate into your local repo.
44+
1. disable all the gpg signature globally. (Optional)
45+
```
46+
$ git config --global --unset gpg.format
47+
```
48+
2. Create a gpg-key
49+
```
50+
$ gpg --full-generate-key
51+
```
52+
3. Configure the local repo with your new key.
53+
```
54+
$ gpg --list-secret-keys --keyid-format=long
55+
gpg: checking the trustdb
56+
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
57+
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
58+
/c/Users/silabsuser/.gnupg/pubring.kbx
59+
------------------------------------
60+
sec rsa3072/1234567891234567 2025-04-09 [SC]
61+
ABDGDGFDGFDGDHHSRGRG12345667912345678981
62+
uid [ultimate] Firstname Lastname <[email protected]>
63+
ssb rsa3072/11098765432110981 2025-04-09 [E]
64+
65+
$ git config user.signingkey 1234567891234567
66+
```
67+
4. Force every commit to be signed
68+
```
69+
$ git config commit.gpgsign true
70+
```
71+
5. Export your gpg key
72+
```
73+
$ gpg --armor --export 888BA795B7085898
74+
```
75+
Make sure your email address is verified by GitHub before committing anything.
76+
77+
## Licensing
78+
Please check the [Licensing.md](../LICENSE.md) for more details.
79+
80+
## Contributor License Agreement
81+
When a project receives a contribution, it must be clear that the contributor has the rights to contribute the content and that the project then has the rights to use and otherwise operate with the content (e.g., relicense or distribute). A Contributor License Agreement (CLA) is a legal document establishing these rights and defining the terms under which a license is granted by a contributor to an open-source project. A CLA clarifies that any contribution was authorized (not contributing someone else’s code without permission or without legal authority to contribute) and protects the project from potential future legal challenges.
82+
83+
Please check Silicon Labs [CLA document](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/contributor_license_agreement.md).
84+
During the pull request review, every new contributor must sign the CLA document. It can be signed as an individual or on behalf of a company.
85+
Signatures have a 6-month expiration period.
86+
87+
## Contribution process
88+
### Creating an Issue
89+
Please follow the official GitHub [guide](https://opensource.guide/how-to-contribute/#opening-an-issue).
90+
91+
### Fork the repository
92+
When you created an issue and based on the discussion you want to contribute with your source-code.
93+
Branching is disabled on the public Silicon Labs repositories. You need to fork your own repo first.
94+
Please follow the official GitHub [guide](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project).
95+
You can create your branch on your own forked repo now.
96+
97+
### Branch Naming Convention
98+
Branch naming shall follow the following template: *IssueNumber-issue-title-goes-here*
99+
Example branch name:
100+
```
101+
99-bootloader-implementation
102+
```
103+
Issue number is necessary to maintain tracebility.
104+
Now you have a branch. You can start committing your code onto it.
105+
106+
## Commit Messages
107+
108+
Silicon Labs repositories require signed-off commits.
109+
Every commit represents a change inside the repository. Every change needs to be documented extensively.
110+
```
111+
Issuenumber-summary-of-changes
112+
113+
Detailed description what was implemented.
114+
Another line of really good description
115+
```
116+
117+
## Pull Request Guideline
118+
Okay you finished your work committed all your changes to your branch. Time to create a pull request.
119+
Refer to the general pull request [guideline](https://opensource.guide/how-to-contribute/#opening-a-pull-request) from GitHub.
120+
What to consider when raising a Pull Request:
121+
1. **Pull Request Naming**
122+
By default, GitHub uses the branch name as the pull request title. If the branch naming convention was followed, no changes are needed here.
123+
2. **Create Description**
124+
Fill out the pull request template.
125+
3. **Check the Reviewer List**
126+
GitHub assigns reviewers based on the [CODEOWNERS](CODEOWNERS) file.
127+
Add more reviewers if needed. Do not remove reviewers from the PR. Ask the repository owner for updates to the code owners.
128+
4. **Evaluate the Action Workflow Results**
129+
The following workflows are included in every repository:
130+
- **[Coding Convention Check](workflows/00-Check-Code-Convention.yml)**: Analyzes the code formatting and fails if any rules are broken.
131+
- **[Firmware Build](workflows/02-Build-Firmware.yml)**: Builds the firmware inside the [Dockerfile](../Dockerfile).
132+
- **[Secret Scanner](workflows/04-TruffleHog-Security-Scan.yml)**: Runs the TruffleHog security scanner to look for API keys and committed secrets.
133+
134+
### As a Reviewer
135+
136+
What to consider when reviewing a Pull Request:
137+
138+
- All builds must pass successfully.
139+
- The code must follow the Silicon Labs [coding guidelines](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/coding_standard.md).
140+
- Write clear comments. Describe the issue and explain why you disagree (e.g., mistakes, errors, violations of conventions, performance risks, security issues, etc.).
141+
- If any comments must be addressed mandatorily, mark the pull request as “Draft.”
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: 'Bug: '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Additional context**
27+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: 'Feature: '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Description
2+
<!-- Provide a brief description of the changes in this pull request. -->
3+
4+
## Related Issue
5+
<!-- If this pull request addresses an issue, link to it here. -->
6+
Closes #<issue_number>
7+
8+
## Changes Made
9+
<!-- List the changes made in this pull request. -->
10+
-
11+
12+
## Checklist
13+
- [ ] I have read the [Contributor License Agreement](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/contributor_license_agreement.md).
14+
- [ ] I have followed the repository's [coding guidelines](https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/coding_standard.md) .
15+
- [ ] I have checked the action workflow results and they are all passed.
16+
17+
## Screenshots (if applicable)
18+
<!-- Add screenshots to help explain the changes (if applicable). -->
19+
20+
## Additional Notes
21+
<!-- Add any additional information or context. -->

.github/coding-convention-tool

Submodule coding-convention-tool added at bb792db
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: 00-Check-Code-Convention
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
6+
- master
7+
- "tests/**"
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
- "release/**"
13+
workflow_dispatch:
14+
inputs:
15+
branch:
16+
description: 'Branch to test'
17+
type: string
18+
default: 'main'
19+
20+
jobs:
21+
job1:
22+
name: Check coding convention
23+
runs-on: ubuntu-22.04 #uncrustify 0.64 can not be compiled on ubuntu-24.04
24+
steps:
25+
- name: Trigger
26+
run: echo "Triggered by ${{github.event_name}} event"
27+
- name: Check Branch Input
28+
run: |
29+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
30+
if [ -z "${{ github.event.inputs.branch }}" ]; then
31+
echo "Branch input is required for manual trigger."
32+
exit 1
33+
fi
34+
fi
35+
- name: Checkout
36+
uses: actions/[email protected]
37+
with:
38+
ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}"
39+
submodules: true
40+
fetch-depth: 0
41+
- name: Log Current Branch and Commit
42+
run: |
43+
echo "Current branch: $(git rev-parse --abbrev-ref HEAD)"
44+
echo "Current commit: $(git rev-parse HEAD)"
45+
- name: Install commit check tools
46+
run: |
47+
echo "Installing pre-commit ..."
48+
python3 -m pip install pre-commit
49+
echo "Installing uncrustify 0.64 from source code ..."
50+
sudo apt-get install --no-install-recommends -y\
51+
binutils ca-certificates git cmake make \
52+
gcc g++ binutils libc6-dev
53+
echo "Cloning Uncrustify repository..."
54+
git clone -b uncrustify-0.64 --single-branch https://github.com/uncrustify/uncrustify.git
55+
echo "Building and installing Uncrustify..."
56+
mkdir ./uncrustify/build && cd ./uncrustify/build
57+
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=RelWithDebInfo ../
58+
sudo make -j "$(nproc)"
59+
sudo make install
60+
echo "Uncrustify has been installed successfully!"
61+
cd ../../
62+
sudo cp ./.github/coding-convention-tool/tools/uncrustify/uncrustify.cfg ./uncrustify/uncrustify.cfg
63+
echo "Install clang-tidy"
64+
sudo apt-get install clang-tidy
65+
- name: Run test
66+
run: |
67+
pre-commit install --config .github/coding-convention-tool/.pre-commit-config.yaml
68+
pre-commit run --config .github/coding-convention-tool/.pre-commit-config.yaml --all-files 2>&1 | tee CodingConventionTool.txt
69+
git diff > code-fix.patch || echo "No changes to patch."
70+
ls -lah code-fix.patch
71+
72+
- name: Upload Result
73+
uses: actions/[email protected]
74+
with:
75+
name: CodingConventionResult
76+
path: CodingConventionTool.txt
77+
retention-days: 90
78+
- name: Upload Patch
79+
uses: actions/[email protected]
80+
with:
81+
name: code-fix.patch
82+
path: code-fix.patch
83+
retention-days: 90
84+
- name: Check log file to set status of the job
85+
run: |
86+
keywords=("Failed")
87+
for keyword in "${keywords[@]}"; do
88+
if grep -q "$keyword" CodingConventionTool.txt; then
89+
echo "Keyword '$keyword' found in the file."
90+
exit 1
91+
else
92+
echo "Keyword '$keyword' not found in the file."
93+
fi
94+
done
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 01-CLA-Assistant
2+
## This workflow is used for public repositories
3+
4+
on:
5+
workflow_dispatch:
6+
#issue_comment:
7+
# types: [created]
8+
#pull_request_target:
9+
# types: [opened,closed,synchronize,reopened]
10+
11+
permissions:
12+
actions: write
13+
contents: read # this can be 'read' if the signatures are in remote repository
14+
pull-requests: write
15+
statuses: write
16+
17+
jobs:
18+
CLAAssistant:
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- name: Create CLA Assistant Lite bot token
22+
uses: actions/create-github-app-token@v2
23+
id: app-token
24+
with:
25+
app-id: ${{ secrets.GH_APP_ID }}
26+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
27+
owner: SiliconLabsInternal
28+
repositories: contributor-license-agreements
29+
30+
- name: "CLA Assistant"
31+
if: ${{ contains(github.event.comment.body, 'I have read the CLA Document and I hereby sign the CLA') }} || github.event_name == 'pull_request_target'
32+
uses: SiliconLabsSoftware/action-cla-assistant@silabs_flavour_v2
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
PERSONAL_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
36+
with:
37+
path-to-signatures: "cla_signatures_db.json"
38+
path-to-document: "https://github.com/SiliconLabsSoftware/agreements-and-guidelines/blob/main/contributor_license_agreement.md"
39+
branch: 'cla-database'
40+
allowlist: silabs-*,bot*
41+
# the following are the optional inputs - If the optional inputs are not given, then default values will be taken
42+
remote-organization-name: "SiliconLabsInternal"
43+
remote-repository-name: "contributor-license-agreements"
44+
create-file-commit-message: "Created the CLA database file. CLA Assistant Lite bot created this file."
45+
signed-commit-message: "$contributorName has signed the CLA in $owner/$repo#$pullRequestNo"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 02-Build-Firmware
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- master
8+
- "release/**"
9+
workflow_dispatch:
10+
inputs:
11+
branch:
12+
description: 'Branches to run the workflow on'
13+
required: true
14+
default: 'main'
15+
16+
jobs:
17+
FW_build:
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
ref: ${{ github.event.inputs.branch }}
25+
26+
- name: Build Docker Image
27+
run: docker build -t ${{ github.repository }}-build-env:latest .
28+
29+
- name: Run Docker Container
30+
run: docker run --rm -v ${{ github.workspace }}:/workspace ${{ github.repository }}-build-env:latest /bin/bash -c "cd /workspace && make all"
31+
32+
- name: Clean up workspace
33+
if: always()
34+
run: sudo git clean -ffdx

0 commit comments

Comments
 (0)