Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy-s committed Apr 26, 2024
0 parents commit e32b683
Show file tree
Hide file tree
Showing 82 changed files with 27,819 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bazel-radiant-cpp
bazel-bin
bazel-out
bazel-testlogs
9 changes: 9 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Enables c++ toolchain selection via the new "platforms" mechanism
# This flag will likely not be needed anymore when bazel 7.0.0 releases
build --incompatible_enable_cc_toolchain_resolution

# For access to cc_shared_library (experimental for years. default enabled 2023 Q1)
build --experimental_cc_shared_library

# Remove error output limit
build --experimental_ui_max_stdouterr_bytes=-1
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.1.1
65 changes: 65 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
BasedOnStyle: Microsoft
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 80
ReflowComments: true
AccessModifierOffset: -4
SortIncludes: Never
UseCRLF: false

BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakInheritanceList: AfterComma
SeparateDefinitionBlocks: Always
AlwaysBreakTemplateDeclarations: Yes

BinPackArguments: false
BinPackParameters: false
AllowAllArgumentsOnNextLine: false
PointerAlignment: Left
ReferenceAlignment: Left
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Right
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignEscapedNewlines: Right
AlignOperands: Align
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: false
IndentGotoLabels: false
Cpp11BracedListStyle: false
SpaceBeforeCpp11BracedList: false
EmptyLineAfterAccessModifier: Always
LambdaBodyIndentation: Signature
NamespaceIndentation: None
PackConstructorInitializers: Never
SortUsingDeclarations: false
QualifierAlignment: Custom
QualifierOrder: ['static', 'constexpr', 'inline', 'type']
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.h linguist-language=cpp
*.hpp linguist-language=cpp
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/01-bug-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug Report
description: Report bugs or other issues.
labels: ["bug"]
body:
- type: textarea
attributes:
label: Brief description of your issue
placeholder: Briefly describe your issue here.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce (optional)
placeholder: How to reproduce the issue?
validations:
required: false
- type: textarea
attributes:
label: Expected behavior (optional)
placeholder: What did you expect to happen?
validations:
required: false
- type: textarea
attributes:
label: Actual behavior (optional)
placeholder: What is currently happening?
validations:
required: false
- type: textarea
attributes:
label: Environment (optional)
placeholder: |
Operating System version(s)
Compiler version(s)
C++ standard version(s)
Any other information?
render: shell
validations:
required: false
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/02-feature-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Feature Request
description: Suggest features, modifications, ideas, or suggestions.
labels: ["enhancement"]
body:
- type: textarea
attributes:
label: Description of the feature, modification, idea, or suggestion.
validations:
required: true
- type: textarea
attributes:
label: Proposed implementation details (optional)
placeholder: Suggest how to implement the feature.
validations:
required: false
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
blank_issues_enabled: true
contact_links:
- name: General Questions
url: https://github.com/archonitelabs/radiant-cpp/discussions/new
about: Have a question? Start a new discussion.
- name: Review Open Issues
url: https://github.com/archonitelabs/radiant-cpp/issues
about: Check existing enhancments or bug reports.
- name: Create a Blank Issue
url: https://github.com/archonitelabs/radiant-cpp/issues/new
about: Create a blank issue for anything else.
40 changes: 40 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Build

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

jobs:
Release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.8.2
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Build and Run Unit Tests
run: bazel build -c opt //...
NoSTD:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.8.2
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Build and Run Unit Tests
run: bazel build --copt=-DRAD_NO_STD //...
35 changes: 35 additions & 0 deletions .github/workflows/cache-cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Cleanup Branch Caches

on:
pull_request:
types:
- closed
workflow_dispatch:

# yamllint disable rule:
jobs:
Cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup Caches
# yamllint disable rule:line-length
run: |
gh extension install actions/gh-actions-cache
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
# yamllint enable rule:line-length
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
38 changes: 38 additions & 0 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: "CLA Assistant"

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

permissions:
actions: write
checks: read
contents: read
issues: read
discussions: read
pull-requests: write
statuses: read

# yamllint disable rule:line-length
jobs:
CLAssistant:
if: ${{ github.event_name == 'pull_request_target' || github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: cla-assistant/github-action@dbc1c64d82d3aad5072007a41fff2828ae6d23ec
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT_TOKEN }}
with:
path-to-signatures: 'radiant-cpp/cla-signatures.json'
path-to-document: 'https://github.com/archonitelabs/radiant-cpp/blob/main/CLA.md'
branch: 'main'
remote-organization-name: 'archonitelabs'
remote-repository-name: 'archonitelabs-cla'
lock-pullrequest-aftermerge: false
# yamllint enable rule:line-length
43 changes: 43 additions & 0 deletions .github/workflows/code-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Code Coverage

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

jobs:
CodeCoverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.8.2
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: ./tools/rad/setup.py
- name: Install Rad Tool
run: pip install -e ./tools/rad
- name: Generate Coverage
run: rad coverage --output-xml ./coverage.xml -vv
- name: Upload Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: archonitelabs/radiant-cpp
fail_ci_if_error: true
verbose: true
files: ./coverage.xml
29 changes: 29 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Lint

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

jobs:
Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: ./tools/rad/setup.py
- name: Install Rad Tool
run: pip install -e ./tools/rad
- name: Run Linter
run: rad lint --all-files --skip no-commit-to-branch
Loading

0 comments on commit e32b683

Please sign in to comment.