Skip to content

Commit

Permalink
Orca v0.1 - C + Python (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
bejager authored Jan 26, 2024
1 parent 738f89f commit d4c395d
Show file tree
Hide file tree
Showing 86 changed files with 3,886 additions and 2 deletions.
88 changes: 88 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
Cpp11BracedListStyle: true
AccessModifierOffset: -4
AlignConsecutiveMacros: true
AlignTrailingComments: false
AlignAfterOpenBracket: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AlignArrayOfStructures: Left
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterExternBlock: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
# BraceBreakingStyle: Attach
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CommentPragmas: '^[^ ]'
CompactNamespaces: false
ContinuationIndentWidth: 8
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
InsertTrailingCommas: Wrapped
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.py linguist-detectable=true
demo/** linguist-detectable=false
lib/** linguist-detectable=false
resources/** linguist-detectable=false
87 changes: 87 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Bug report
description: Bugs in Orca
title: "Orca Issue: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
**Before** reporting an issue, make sure to read the [documentation](https://picovoice.ai/docs/orca/) and search [existing issues](https://github.com/Picovoice/orca/issues).
- type: checkboxes
id: check
attributes:
label: Have you checked the docs and existing issues?
description: Make sure you have checked all of the below before submitting an issue
options:
- label: I have read all of the relevant Picovoice Orca docs
required: true
- label: I have searched the existing issues for Orca
required: true
- type: dropdown
id: sdk
attributes:
label: SDK
options:
- C
- Python
- Web
validations:
required: true
- type: input
id: package
attributes:
label: "Orca package version"
placeholder: "0.1.0"
validations:
required: true
- type: input
id: framework
attributes:
label: "Framework version"
placeholder: "Python 3.7, .NET Core 3.1, etc."
validations:
required: true
- type: dropdown
id: platform
attributes:
label: Platform
options:
- Linux (x86_64)
- macOS (x86_64, arm64)
- Windows (x86_64)
- Raspberry Pi
- NVIDIA Jetson
validations:
required: true
- type: input
id: os
attributes:
label: "OS/Browser version"
placeholder: "macOS 11.0, Android 8.0, etc."
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1.
2.
3.
validations:
required: true
- type: textarea
id: expectation
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: true
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Documentation
description: Issues around documentation of Orca
title: "Orca Documentation Issue: "
labels: ["documentation"]
body:
- type: input
id: url
attributes:
label: What is the URL of the doc?
validations:
required: true
- type: textarea
id: issue
attributes:
label: What is the nature of the issue?
description: e.g. steps do not work, typos/grammar/spelling, out of date, etc.
validations:
required: true
32 changes: 32 additions & 0 deletions .github/workflows/c-codestyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: C Codestyle

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- '**/*.c'
- '.github/workflows/c-codestyle.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '**/*.c'
- '.github/workflows/c-codestyle.yml'

jobs:
check-c-codestyle:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: sudo apt install clang-format

- name: Check c codestyle
run: python3 resources/.lint/c/formatter.py -c -v
112 changes: 112 additions & 0 deletions .github/workflows/c-demos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: C Demos

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- '.github/workflows/c-demos.yml'
- 'demo/c/**'
- 'lib/common/**'
- 'lib/jetson/**'
- 'lib/linux/**'
- 'lib/mac/**'
- 'lib/raspberry-pi/**'
- 'lib/windows/**'
- '!demo/c/README.md'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '.github/workflows/c-demos.yml'
- 'demo/c/**'
- 'lib/common/**'
- 'lib/jetson/**'
- 'lib/linux/**'
- 'lib/mac/**'
- 'lib/raspberry-pi/**'
- 'lib/windows/**'
- '!demo/c/README.md'

defaults:
run:
working-directory: demo/c

jobs:
build-demo-github-hosted:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
platform: linux
arch: x86_64
make_file: "Unix Makefiles"
- os: windows-latest
platform: windows
arch: amd64
make_file: "MinGW Makefiles"
- os: macos-latest
platform: mac
arch: x86_64
make_file: "Unix Makefiles"

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Python '3.10'
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Create build directory
run: cmake -G "${{ matrix.make_file }}" -B ./build

- name: Build demo
run: cmake --build ./build --target orca_demo

- name: Test
run: python test/test_orca_c.py ${{secrets.PV_VALID_ACCESS_KEY}} ${{ matrix.platform }} ${{ matrix.arch }}

build-demo-self-hosted:
runs-on: ${{ matrix.machine }}

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, jetson]
include:
- machine: rpi3-32
platform: raspberry-pi
arch: cortex-a53
- machine: rpi3-64
platform: raspberry-pi
arch: cortex-a53-aarch64
- machine: rpi4-32
platform: raspberry-pi
arch: cortex-a72
- machine: rpi4-64
platform: raspberry-pi
arch: cortex-a72-aarch64
- machine: rpi5-64
platform: raspberry-pi
arch: cortex-a76-aarch64
- machine: jetson
platform: jetson
arch: cortex-a57-aarch64

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Create build directory
run: cmake -B ./build

- name: Build demo
run: cmake --build ./build --target orca_demo

- name: Test
run: python3 test/test_orca_c.py ${{secrets.PV_VALID_ACCESS_KEY}} ${{ matrix.platform }} ${{ matrix.arch }}
18 changes: 18 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check Markdown links

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main, 'v[0-9]+.[0-9]+']

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/[email protected]
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
Loading

0 comments on commit d4c395d

Please sign in to comment.