Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
elenakrittik committed Apr 4, 2024
1 parent e524065 commit 091695b
Show file tree
Hide file tree
Showing 27 changed files with 1,478 additions and 2 deletions.
112 changes: 112 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Options are listed here:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
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: AfterColon
BreakStringLiterals: true
ColumnLimit: 100
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: false
DerivePointerAlignment: false
EmptyLineBeforeAccessModifier: LogicalBlock
EmptyLineAfterAccessModifier: Never
FixNamespaceComments: false
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: true
KeepEmptyLinesAtTheStartOfBlocks: true
Language: Cpp
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: true
SpacesInSquareBrackets: false
Standard: c++17
TabWidth: 4
UseCRLF: false
UseTab: Never
96 changes: 96 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Main

on:
push:
paths-ignore:
- '.gitignore'
- '*.md'

jobs:
lint:
name: 🧹 Lint / 📜 C++
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check
uses: jidicula/[email protected]
with:
clang-format-version: '15'
exclude-regex: 'extern'

build:
strategy:
fail-fast: false
matrix:
build_type: ['Debug', 'Release']
config:
- { name: '🍏 macOS Clang', os: macos-latest }
- { name: '🐧 Linux GCC', os: ubuntu-latest }
- { name: '🪟 Windows MSVC', os: windows-latest }

name: 🛠 Build / ${{ matrix.config.name }} (${{ matrix.build_type }})
runs-on: ${{ matrix.config.os }}

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

- name: Install Dependencies (macOS)
if: matrix.config.os == 'macos-latest'
run: brew install ccache ninja

- name: Install Dependencies (Linux)
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y ccache ninja-build
- name: Install Dependencies (Windows)
if: matrix.config.os == 'windows-latest'
run: |
choco upgrade ccache ninja
- name: Setup MSVC (Windows)
if: matrix.config.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1

- name: ccache
uses: hendrikmuhs/[email protected]
with:
max-size: '10G'
key: ${{ matrix.config.os }}-${{ matrix.build_type }}

- name: Configure
run: >
mkdir GDExtension-build
cmake
-B GDExtension-build
-G "Ninja"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
--install-prefix ${{ github.workspace }}/install-${{ matrix.build_type }}
.
- name: Build
run: cmake --build GDExtension-build

- name: Install
run: cmake --install GDExtension-build

- name: Upload artifact (Debug)
if: matrix.build_type == 'Debug'
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-Debug
path: |
${{ github.workspace }}/install-${{ matrix.build_type }}/*
- name: Upload artifact (Release)
if: matrix.build_type == 'Release'
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-Release
path: |
${{ github.workspace }}/install-${{ matrix.build_type }}/*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CMakeLists.txt.user
.vscode/settings.json
GDExtensionTemplate*
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "extern/godot-cpp"]
path = extern/godot-cpp
url = https://github.com/godotengine/godot-cpp
branch = 4.1
branch = 4.2
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cmake-tools"
]
}
Loading

0 comments on commit 091695b

Please sign in to comment.