Skip to content

Commit

Permalink
Node-Addon / Rest-Server Support (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: V <[email protected]>
  • Loading branch information
Curve and Vendicated authored Oct 13, 2023
1 parent 37fe7c9 commit 6a013af
Show file tree
Hide file tree
Showing 30 changed files with 2,772 additions and 1,025 deletions.
99 changes: 99 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
Language: Cpp
InsertNewlineAtEOF: true
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments:
Enabled: true
AcrossComments: false
AcrossEmptyLines: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
BeforeLambdaBody: true
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: false
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
FixNamespaceComments: true
IndentCaseLabels: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
NamespaceIndentation: All
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
TabWidth: 4
UseCRLF: false
UseTab: Never
45 changes: 45 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
Checks: "*,
-abseil-*,
-altera-*,
-android-*,
-fuchsia-*,
-google-*,
-llvm*,
-modernize-use-trailing-return-type,
-zircon-*,
-readability-else-after-return,
-readability-static-accessed-through-instance,
-readability-avoid-const-params-in-decls,
-cppcoreguidelines-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes,
-readability-redundant-access-specifiers,
-cppcoreguidelines-special-member-functions,
-hicpp-special-member-functions,
-readability-implicit-bool-conversion,
-hicpp-explicit-conversions,
-*-magic-numbers,
-readability-named-parameter,
-hicpp-named-parameter,
-readability-identifier-length,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-avoid-non-const-global-variables,
-hicpp-signed-bitwise,
-*-uppercase-literal-suffix,
-*-cognitive-complexity,
-*-multiway-paths-covered,
-*-switch-missing-default-case,
-*-avoid-endl,
-cppcoreguidelines-pro-type-static-cast-downcast,
-misc-header-include-cycle,
-cppcoreguidelines-pro-type-vararg,
-*-member-init,
-bugprone-easily-swappable-parameters,
-hicpp-vararg,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-*-dcl21-cpp,
"
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
42 changes: 42 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
env: {
node: true,
},
extends : ["eslint:recommended"],
parserOptions: {
ecmaVersion: "latest",
sourceType : "module",
},
rules: {
"object-curly-spacing": ["error", "always"],
"brace-style" : ["error", "allman"],
quotes : ["error", "double"],
semi : ["error", "always"],
"linebreak-style" : ["error", "unix"],
indent : ["error", 4],
"no-else-return" : 1,
"space-unary-ops" : 2,
"keyword-spacing" : ["error", {
"before": true,
"after" : true,
}],
"arrow-spacing" : "error",
"comma-spacing" : ["error", { "before": false, "after": true }],
"space-infix-ops" : ["error", { "int32Hint": false }],
"space-before-blocks": ["error", { "functions": "always", "keywords": "always", "classes": "always" }],
"no-multi-spaces" : "error",
"no-trailing-spaces" : "error",
"semi-spacing" : "error",
"key-spacing" : [2, {
"singleLine": {
"beforeColon": false,
"afterColon" : true
},
"multiLine": {
"beforeColon": false,
"afterColon" : true,
"align" : "colon"
}
}]
},
};
112 changes: 112 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
on:
push:
pull_request:

name: 🏗️ Build

jobs:
build-arch-server:
runs-on: ubuntu-latest
container: archlinux:base-devel

steps:
- name: 📥 Checkout
uses: actions/checkout@v3

- name: 👷 Build Dependencies
run: "pacman --noconfirm -Syu base-devel cmake gcc git make pipewire pipewire-pulse"

- name: 🔨 Build
run: |
cmake -B build
cmake --build build
- name: 🚀 Upload Artifact
uses: actions/upload-artifact@v3
with:
name: server-arch
path: build/server

build-arch-addon:
runs-on: ubuntu-latest
container: archlinux:base-devel

steps:
- name: 📥 Checkout
uses: actions/checkout@v3

- name: 👷 Build Dependencies
run: "pacman --noconfirm -Syu base-devel cmake gcc git make pipewire pipewire-pulse"

- name: 🍃 Install Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: 🍃 Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: 🔨 Build
run: "pnpm install"

- name: 🚀 Upload Artifact
uses: actions/upload-artifact@v3
with:
name: addon-arch
path: build/Release

build-fedora-server:
runs-on: ubuntu-latest
container: fedora:latest

steps:
- name: 📥 Checkout
uses: actions/checkout@v3

- name: 👷 Build Dependencies
run: "dnf install -y pipewire-devel make automake git gcc gcc-c++ kernel-devel cmake"

- name: 🔨 Build
run: |
cmake -B build
cmake --build build
- name: 🚀 Upload Artifact
uses: actions/upload-artifact@v3
with:
name: server-fedora
path: build/server

build-fedora-addon:
runs-on: ubuntu-latest
container: fedora:latest

steps:
- name: 📥 Checkout
uses: actions/checkout@v3

- name: 👷 Build Dependencies
run: "dnf install -y pipewire-devel make automake git gcc gcc-c++ kernel-devel cmake"

- name: 🍃 Install Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: 🍃 Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: 🔨 Build
run: "pnpm install"

- name: 🚀 Upload Artifact
uses: actions/upload-artifact@v3
with:
name: addon-fedora
path: build/Release
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
push:
pull_request:

name: 🧪 Test

jobs:
test-addon:
runs-on: ubuntu-latest
container: archlinux:base-devel

steps:
- name: 📥 Checkout
uses: actions/checkout@v3

- name: 👷 Build Dependencies
run: "pacman --noconfirm -Syu base-devel cmake gcc git make pipewire pipewire-pulse"

- name: 🍃 Install Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: 🍃 Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: 🔨 Build
run: "pnpm install"

- name: 🧪 Test
run: "pnpm run test"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
node_modules
.vscode
build
16 changes: 0 additions & 16 deletions .vscode/c_cpp_properties.json

This file was deleted.

Loading

0 comments on commit 6a013af

Please sign in to comment.