Skip to content

Commit

Permalink
import docs and scripts from esp-idf SDK
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Miller <[email protected]>
  • Loading branch information
ncmiller committed Oct 4, 2022
1 parent b68788a commit 68b0db2
Show file tree
Hide file tree
Showing 27 changed files with 3,897 additions and 3 deletions.
84 changes: 84 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# clang-format configuration file
#
# Please seek consensus from the team before modifying this file.
#
# To compare these settings with all available clang-format options:
# diff <(clang-format -dump-config | grep -Ev '^$|^( |BraceWrapping|IncludeCategories)' | sed -Ee 's/: +/: /g' | sort) <(cat .clang-format | grep -Ev '^$|^#' | sort) | colordiff
#
---
DisableFormat: false
Language: Cpp
Standard: Cpp11

# Indentation & whitespace
AccessModifierOffset: -4
ColumnLimit: 100
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
SpacesBeforeTrailingComments: 2
TabWidth: 4
UseTab: Never

# Spacing style
Cpp11BracedListStyle: true
DerivePointerAlignment: false
PointerAlignment: Left
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

# Comments
AlignTrailingComments: true
CommentPragmas: ''
FixNamespaceComments: true
ReflowComments: true

# Pattern-based special behavior
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories: []
MacroBlockBegin: ''
MacroBlockEnd: ''
SortIncludes: false

# Alignment & breaking
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakStringLiterals: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true

# Prevent return type from being on a line of its own
PenaltyReturnTypeOnItsOwnLine: 1000
...
62 changes: 62 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# EditorConfig: https://editorconfig.org/

# top-most EditorConfig file
root = true

# All (Defaults)
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 100

# C
[*.{c,h}]
indent_style = space
indent_size = 4

# C++
[*.{cpp,hpp}]
indent_style = space
indent_size = 4

# Python
[*.py]
indent_style = space
indent_size = 4

# reStructuredText
[*.rst]
indent_style = space
indent_size = 4

# YAML
[*.{yml,yaml}]
indent_style = space
indent_size = 4

# Shell Script
[*.sh]
indent_style = space
indent_size = 4

# CMake
[{CMakeLists.txt,*.cmake}]
indent_style = space
indent_size = 4

# Makefile
[Makefile]
indent_style = tab
indent_size = 8

# Git commit messages
[COMMIT_EDITMSG]
max_line_length = 75

# Kconfig
[Kconfig*]
indent_style = space
indent_size = 4

59 changes: 59 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 🐞 Bug Report
description: File a bug report
labels: ["bug"]
body:
- type: input
id: sdk-version
attributes:
label: Golioth Firmware SDK Commit Hash
description: Run `git show HEAD -s --format='%H'` in your copy of the Golioth Firmware SDK repository
validations:
required: true
- type: input
id: platform-os
attributes:
label: Platform/OS
description: e.g. ESP-IDF v4.4.1, ModusToolbox 2.4.0
validations:
required: true
- type: input
id: hardware-target
attributes:
label: Hardware Target
description: What hardware platform are you using? (e.g. ESP32, ESP32S3, ESP32C3, etc)
validations:
required: false
- type: textarea
id: host-os
attributes:
label: What host OS are you using?
description: Linux users, please share the contents of /etc/os-release (`cat /etc/os-release`)
- type: textarea
id: current-behavior
attributes:
label: Current Behavior
description: A concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1.
2.
3.
validations:
required: false
- type: textarea
id: logs
attributes:
label: Logs, console output, or any kind of debug information
description: Please copy and paste any relevant debug information. This will be automatically formatted into code, so no need for backticks.
render: shell
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Discord
url: https://discord.com/invite/qKjmvzMVYR
about: Chat with the community and our team on Discord.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 🚀 Feature request
description: Suggest new features or enhancements to existing features
labels: ["enhancement"]
body:
- type: textarea
id: proposal
attributes:
label: Describe the feature
description: A concise description of the functionality you would like to have
validations:
required: true
- type: input
id: feature-reference
attributes:
label: Existing feature reference
description: Does this request relate to an existing feature? If so, please provide its name.
validations:
required: false
26 changes: 26 additions & 0 deletions .github/workflows/firebase-doxygen-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy Doxygen to Firebase Hosting on Main
'on':
push:
branches:
- main
jobs:
deploy_doxygen_prod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Doxygen
run: sudo apt install doxygen graphviz
- name: Generate Doxygen
run: |
cd docs/doxygen
doxygen
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_GOLIOTH }}'
channelId: live
projectId: golioth
target: docs-prod
entryPoint: docs
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
25 changes: 25 additions & 0 deletions .github/workflows/firebase-doxygen-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy Doxygen to Firebase Hosting on PR
'on': pull_request
jobs:
deploy_doxygen_dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Doxygen
run: sudo apt install doxygen graphviz
- name: Generate Doxygen
run: |
cd docs/doxygen
doxygen
- name: Deploy docs to dev
# The 'if' will prevent running this step if in a fork pull request
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_GOLIOTH }}'
projectId: golioth
target: docs-dev
entryPoint: docs
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
40 changes: 40 additions & 0 deletions .github/workflows/lint_and_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Firmware Build

on:
push:
branches: [ main ]
pull_request:

jobs:
lint_and_build_examples:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
architecture: 'x64'
- name: Check code formatting
shell: bash
run: |
git fetch --no-recurse-submodules
echo "Checking code format"
sudo apt install clang-format
REPO_ROOT=`pwd` ./scripts/lint/ci_check_clang_format.sh
- name: Build golioth_basics project
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v4.4.1
target: esp32
path: 'examples/esp_idf/golioth_basics'
- name: Build magtag_demo project
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v4.4.1
target: esp32
path: 'examples/esp_idf/magtag_demo'
# TODO - build ModusToolbox examples
Loading

0 comments on commit 68b0db2

Please sign in to comment.