Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Quality gates and release management #4

Merged
merged 38 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0522279
ci: Initialize CI pipelines
XavierBrassoud Feb 16, 2024
6720edb
Add Arduino, C++ and PR title linters
XavierBrassoud Feb 16, 2024
3cd1eed
Test c++ linter
XavierBrassoud Feb 16, 2024
afa8edd
Remove matrix
XavierBrassoud Feb 16, 2024
828c962
Fix cpp lint style
XavierBrassoud Feb 16, 2024
4b44221
Define .clang-format style
XavierBrassoud Feb 17, 2024
542ff89
Clang format
XavierBrassoud Feb 17, 2024
24ca8df
Refactor: clang-tidy compliant
XavierBrassoud Mar 7, 2024
5918bb3
ci: cpp-linter adaptations
XavierBrassoud Mar 7, 2024
596a8ef
Provide action permissions
XavierBrassoud Mar 7, 2024
6acfe07
Move permissions
XavierBrassoud Mar 7, 2024
5eec3a6
test permissions #2
XavierBrassoud Mar 7, 2024
426eef2
Test permissions #3
XavierBrassoud Mar 7, 2024
d11ddb3
Test permissions #4
XavierBrassoud Mar 7, 2024
fad6b8d
Ignore extras from quality
XavierBrassoud Mar 7, 2024
e5b2141
Update clang-tidy version
XavierBrassoud Mar 7, 2024
f278625
Install Arduino CLI
XavierBrassoud Mar 7, 2024
d1240c6
Switch to PIO checks for consistency
XavierBrassoud Mar 7, 2024
256c769
Fix clang-tidy
XavierBrassoud Mar 7, 2024
18af6cb
Add clang-format
XavierBrassoud Mar 7, 2024
c0cfae0
Add voluntary format error
XavierBrassoud Mar 7, 2024
0592129
clang-format
XavierBrassoud Mar 7, 2024
fe32e8e
Fix release-please
XavierBrassoud Apr 30, 2024
9f1f3bb
Fix release-please missing files
XavierBrassoud May 2, 2024
0a1bc55
Remove testing branch from release
XavierBrassoud May 2, 2024
0e02bff
Fix duplicate launched action: Quality Gates
XavierBrassoud May 2, 2024
2630256
Enhance PIO build process
XavierBrassoud May 2, 2024
951ffd4
Fix cast issues
XavierBrassoud May 2, 2024
6c64204
Allow all architectures
XavierBrassoud May 2, 2024
e14c808
Update example section
XavierBrassoud May 2, 2024
cd57dab
Add arduino-lint
XavierBrassoud May 2, 2024
5ce17b5
Add CONTRIBUTING.md
XavierBrassoud May 2, 2024
8d92432
Publish to PlatformIO Library manager
XavierBrassoud May 2, 2024
9e5ef7d
Switch Arduino lint to submit
XavierBrassoud May 2, 2024
a03fe25
Rename scripts folder to pio-tools
XavierBrassoud May 2, 2024
93fa518
Set lib_deps per example
XavierBrassoud May 2, 2024
186feb9
Add sponsorship program
XavierBrassoud May 2, 2024
7e2c731
Shortened sentence in "using display" section
XavierBrassoud May 2, 2024
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
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BasedOnStyle: Microsoft
46 changes: 46 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
Checks: >
-*,
clang-diagnostic-*,
clang-analyzer-*,
bugprone-*,
google-*,
cert-*-c,
misc-*,
performance-*,
portability-*,
readability-*,
modernize-*,
-modernize-use-trailing-return-type

WarningsAsErrors: ''
AnalyzeTemporaryDtors: false
FormatStyle: file
HeaderFilterRegex: ''
CheckOptions:
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.VariableCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberSuffix
value: _
- key: readability-identifier-naming.ProtectedMemberSuffix
value: _
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.ConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.PointerParameterCase
value: CamelCase
- key: readability-identifier-naming.PointerParameterPrefix
value: p
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: paypal.me/XavierBrassoud
20 changes: 20 additions & 0 deletions .github/workflows/lint_git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
lint-git:
name: Validate PR title
runs-on: ubuntu-22.04
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Quality Gates

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI

permissions:
contents: write
pull-requests: write

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: arduino-lint
uses: arduino/arduino-lint-action@v1
with:
library-manager: submit # TODO: swith to "update" when approved by the Arduino Team
compliance: strict

- name: Code format
uses: jidicula/[email protected]
with:
clang-format-version: '15' # equals to PIO clang version
check-path: 'src'

- name: Cache pio and pip
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio

- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Code lint
run: pio check --fail-on-defect=high --fail-on-defect=medium
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:

release-please:
runs-on: ubuntu-22.04
steps:
# Add packages to update into release-please-config.json
- name: Write new version to packages
uses: google-github-actions/release-please-action@v4
with:
token: ${{ secrets.MAINTAINER_PAT }}
target-branch: ${{ github.ref_name }}

# Steps bellow occurs only when a version is created
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}

- name: Cache pio and pip
if: ${{ steps.release.outputs.release_created }}
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio

- uses: actions/setup-python@v4
if: ${{ steps.release.outputs.release_created }}
with:
python-version: '3.9'

- name: Install PlatformIO Core
if: ${{ steps.release.outputs.release_created }}
run: pip install --upgrade platformio

- name: PlatformIO publish
if: ${{ steps.release.outputs.release_created }}
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PIO_PAT }}
run: pio package publish --type library --no-interactive
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.0"
}
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contribution Guidlines

The best way to ask for help or propose a new idea is to [create a new issue](https://github.com/XavierBrassoud/Arduino_Epson_PNL_CE02/issues/new) while creating a Pull Request with your code changes allows you to share your own innovations with the rest of the community.

The following are some guidelines to observe when creating issues or PRs:

- Be friendly; it is important that we can all enjoy a safe space as we are all working on the same project and it is okay for people to have different ideas

- [Use code blocks](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code); it helps us help you when we can read your code! On that note also refrain from pasting more than 30 lines of code in a post, instead [create a gist](https://gist.github.com/) if you need to share large snippets

- Titles follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) (eg. *feat: My Awesome Feature*, *fix(topic): Something bad*)

- Be detailed; refrain from mentioning code problems without sharing your source code and always give information regarding your board and version of the library

- Ensure your code are properly formed with `clang-format` and passes quality gates with `pio checks`

- Using [Visual Studio Code](https://code.visualstudio.com/) with the [PlatformIO](https://platformio.org/) [extension](https://platformio.org/install/ide?install=vscode) is highly recommended
Loading
Loading