-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: reorganize sources, update ci/devcontainer, formatting, lin…
…ting
- Loading branch information
Showing
27 changed files
with
974 additions
and
3,217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,53 @@ | ||
--- | ||
Checks: 'clang-analyzer-*,readability-braces-around-statements,readability-else-after-return,readability-inconsistent-declaration-parameter-name,modernize-use-equals-default,modernize-use-using,modernize-redundant-void-arg,modernize-concat-nested-namespaces,misc-redundant-expression,readability-static-accessed-through-instance,readability-static-accessed-through-instance,performance-inefficient-vector-operation,readability-identifier-naming' | ||
WarningsAsErrors: '' | ||
AnalyzeTemporaryDtors: false | ||
FormatStyle: file | ||
CheckOptions: | ||
- key: readability-braces-around-statements.ShortStatementLines | ||
value: '0' | ||
- key: readability-inconsistent-declaration-parameter-name.Strict | ||
value: 'true' | ||
- key: readability-identifier-naming.IgnoreMainLikeFunctions | ||
value: 'true' | ||
- key: readability-identifier-naming.FunctionIgnoredRegexp | ||
value: 'main' | ||
- key: readability-identifier-naming.ClassCase | ||
value: 'CamelCase' | ||
- key: readability-identifier-naming.ClassMethodCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.PrivateMemberCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.PrivateMemberPrefix | ||
value: '_' | ||
- key: readability-identifier-naming.ConstexprVariableCase | ||
- key: readability-identifier-naming.ConstantMemberCase | ||
value: 'UPPER_CASE' | ||
- key: readability-identifier-naming.ConstexprFunctionCase | ||
value: 'UPPER_CASE' | ||
- key: readability-identifier-naming.StructCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.StructSuffix | ||
value: '_t' | ||
- key: readability-identifier-naming.EnumConstantCase | ||
value: 'UPPER_CASE' | ||
- key: readability-identifier-naming.ConstantMemberCase | ||
- key: readability-identifier-naming.ConstexprVariableCase | ||
value: 'UPPER_CASE' | ||
- key: readability-identifier-naming.LocalConstantCase | ||
- key: readability-identifier-naming.EnumConstantCase | ||
value: 'UPPER_CASE' | ||
- key: readability-identifier-naming.FunctionIgnoredRegexp | ||
value: 'main' | ||
- key: readability-identifier-naming.GlobalConstantCase | ||
value: 'UPPER_CASE' | ||
- key: readability-identifier-naming.GlobalPointerCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.GlobalVariableCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.IgnoreMainLikeFunctions | ||
value: 'true' | ||
- key: readability-identifier-naming.LocalConstantCase | ||
value: 'UPPER_CASE' | ||
- key: readability-identifier-naming.LocalConstantPointerCase | ||
value: 'UPPER_CASE' | ||
- key: readability-identifier-naming.LocalVariableCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.NamespaceCase | ||
value: 'lower_case' | ||
- key: readability-identifier-naming.ParameterCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.VirtualMethodCase | ||
- key: readability-identifier-naming.PrivateMemberCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.PrivateMemberPrefix | ||
value: '_' | ||
- key: readability-identifier-naming.StaticConstantCase | ||
value: 'UPPER_CASE' | ||
- key: readability-identifier-naming.StaticVariableCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.LocalVariableCase | ||
- key: readability-identifier-naming.StructCase | ||
value: 'CamelCase' | ||
- key: readability-identifier-naming.VirtualMethodCase | ||
value: 'camelBack' | ||
- key: readability-identifier-naming.NamespaceCase | ||
value: 'camelBack' | ||
- key: readability-inconsistent-declaration-parameter-name.Strict | ||
value: 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
GIT_BRANCH_COLOR_CLEAN=$(tput setaf 2) | ||
GIT_BRANCH_COLOR_DIRTY=$(tput setaf 1) | ||
BOLD=$(tput bold) | ||
NORM=$(tput sgr0) | ||
NO_COLOR=$(tput sgr0) | ||
|
||
parse_git_branch() | ||
{ | ||
branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/') | ||
|
||
if [[ -n $branch ]] | ||
then | ||
if [ -n "$(git status --untracked-files=no --porcelain)" ] | ||
then | ||
# Uncommitted changes | ||
branch+='*' | ||
echo "${GIT_BRANCH_COLOR_DIRTY}${BOLD}${branch}${NORM}${NO_COLOR}" | ||
else | ||
echo "${GIT_BRANCH_COLOR_CLEAN}${branch}${NO_COLOR}" | ||
fi | ||
fi | ||
} | ||
|
||
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]\[\033[01;34m\] \w\[\$(parse_git_branch)\]\[\e[00m\]\n> " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM ghcr.io/shanteacontrols/opendeck:381baf2ef11a606d36e5798c302d185ba0f165ee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "${localWorkspaceFolderBasename}", | ||
"build": { | ||
"dockerfile": "Dockerfile.ghcr", | ||
"context": "${localWorkspaceFolder}" | ||
}, | ||
"workspaceMount": "src=${localWorkspaceFolder},dst=/home/ubuntu/workspace/${localWorkspaceFolderBasename},type=bind", | ||
"workspaceFolder": "/home/ubuntu/workspace/${localWorkspaceFolderBasename}", | ||
"mounts": [ | ||
{ | ||
"source": "/dev", | ||
"target": "/dev", | ||
"type": "bind" | ||
}, | ||
{ | ||
"source": "${localEnv:HOME}/.gitconfig", | ||
"target": "/etc/gitconfig", | ||
"type": "bind" | ||
}, | ||
{ | ||
"source": "${localEnv:HOME}/.ssh", | ||
"target": "/home/ubuntu/.ssh", | ||
"type": "bind" | ||
} | ||
], | ||
"runArgs": [ | ||
"--network=host", | ||
"--hostname=${localWorkspaceFolderBasename}" | ||
], | ||
"containerUser": "ubuntu", | ||
"privileged": true, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"llvm-vs-code-extensions.vscode-clangd", | ||
"eamodio.gitlens", | ||
"xaver.clang-format", | ||
"timonwong.shellcheck", | ||
"marus25.cortex-debug" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,28 +4,109 @@ on: [push] | |
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: paradajz168/opendeck-dev:latest | ||
options: --user root | ||
name: Build/Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark repository as safe | ||
run: git config --global --add safe.directory /__w/midi-lib/midi-lib | ||
- name: Pull the repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
submodules: false | ||
- name: Check formatting | ||
fetch-depth: 0 | ||
- name: Restore ccache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ccache | ||
key: ccache- | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup missing directories and files on the runner | ||
run: | | ||
make format | ||
mkdir -p ~/.ssh | ||
touch ~/.gitconfig | ||
- name: Prepare container | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck # Local name only | ||
imageTag: latest # Local tag only | ||
push: never | ||
- name: Build library | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck | ||
imageTag: latest | ||
push: never | ||
runCmd: | | ||
make | ||
- name: Save ccache | ||
uses: actions/cache/save@v4 | ||
if: always() | ||
with: | ||
path: ccache | ||
key: "ccache-${{ github.run_id }}" | ||
format: | ||
name: Code formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Pull the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup missing directories and files on the runner | ||
run: | | ||
make lib | ||
- name: Lint | ||
run: | | ||
make lint | ||
- name: Run tests | ||
mkdir -p ~/.ssh | ||
touch ~/.gitconfig | ||
- name: Prepare container | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck # Local name only | ||
imageTag: latest # Local tag only | ||
push: never | ||
- name: Check formatting | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck | ||
imageTag: latest | ||
push: never | ||
runCmd: | | ||
make format | ||
lint: | ||
name: Code linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Pull the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup missing directories and files on the runner | ||
run: | | ||
make test | ||
mkdir -p ~/.ssh | ||
touch ~/.gitconfig | ||
- name: Prepare container | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck # Local name only | ||
imageTag: latest # Local tag only | ||
push: never | ||
- name: Lint | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: opendeck | ||
imageTag: latest | ||
push: never | ||
runCmd: | | ||
make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.