Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCompez authored Dec 18, 2024
0 parents commit 805dd8b
Show file tree
Hide file tree
Showing 83 changed files with 9,862 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterFunction: true
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
IndentCaseLabels: false
IndentFunctionDeclarationAfterType: false
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
PointerAlignment: Left
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
Standard: c++17
UseTab: Never
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Checks: '-*,bugprone-argument-comment'
WarningsAsErrors: bugprone-argument-comment
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
114 changes: 114 additions & 0 deletions .github/workflows/sync-from-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
#
# - Run this workflow to pull changes from the template repository.
#
# - Clone this repository. Check out a branch
# - Copy files from the template onto this clone
# - Push the branch to this repository
# - Create a pull request in this repository
#

name: Sync changes from template project.

on:
# cronjob trigger
schedule:
- cron: "17 5 * * 5"

# Run when this file changes
push:
paths:
- .github/workflows/sync-from-template.yml

# Run when manually triggered
workflow_dispatch:

env:
BASE_BRANCH: main
HEAD_BRANCH: chore/sync-from-template
GIT_AUTHOR_NAME: ${{ github.repository_owner }}
GIT_AUTHOR_EMAIL: ${{ github.repository_owner }}@users.noreply.github.com
REPO_TEMPLATE: KambizAsadzadeh/Project-Template
THIS_REPO: ${{ github.repository }}

jobs:
sync-from-template:
# Do not run on the template repository itself
if: github.repository != 'KambizAsadzadeh/Project-Template'
name: Sync changes from KambizAsadzadeh/Project-Template
runs-on: ubuntu-latest
continue-on-error: true

steps:
# Clone the template repository
- name: Check out template repository
uses: actions/checkout@v2
with:
repository: ${{ env.REPO_TEMPLATE }}
token: ${{ github.token }}
path: ${{ env.REPO_TEMPLATE }}

# Clone the target repository. Check out a branch
- name: Check out ${{ github.repository }}
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
token: ${{ github.token }}
path: ${{ github.repository }}
- name: Create branch in ${{ env.THIS_REPO }}
run: |
git -C "${THIS_REPO}" fetch origin "${HEAD_BRANCH}" || true
git -C "${THIS_REPO}" branch -a
git -C "${THIS_REPO}" checkout -B "${HEAD_BRANCH}" \
"remotes/origin/${HEAD_BRANCH}" || \
git -C "${THIS_REPO}" checkout -b "${HEAD_BRANCH}"
# Copy files from the template onto the target clone
- name: Copy template contents
run: |
_files="$(find ${REPO_TEMPLATE} \
! -path "*/.git/*" \
! -path "*/.github/workflows/*" \
! -name ".gitignore" \
! -name "README.md" \
-type f \
-print)"
for _file in ${_files}; do
_src="${_file}"
_dst="${THIS_REPO}/${_file#${REPO_TEMPLATE}/}"
# TODO: Find a more robust / elegant way to get this :point_down:
_dst="${_dst%/*}/"
mkdir -p "${_dst}"
echo "INFO: Copy '${_src}' to '${_dst}'."
cp "${_src}" "${_dst}"
done
git -C "${THIS_REPO}" diff
# Commit changes, if there are any
- name: Commit changes, if any
run: |
git -C ${THIS_REPO} config user.name "${GIT_AUTHOR_NAME}"
git -C ${THIS_REPO} config \
user.email "${GIT_AUTHOR_EMAIL}"
git -C ${THIS_REPO} add .
git -C ${THIS_REPO} commit \
-m "Sync from template@${{ github.sha }}"
# Push the branch to the target repository
- name: Push topic branch
run: git -C ${THIS_REPO} push -u origin "${HEAD_BRANCH}"

# Create a pull request in the target repository
- name: Create pull request
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_USER: ${{ github.actor }}
run: |
pushd ${THIS_REPO}
hub pull-request \
-b "${BASE_BRANCH}" \
-h "${HEAD_BRANCH}" \
--no-edit \
-m "Pull updates from ${REPO_TEMPLATE}" \
-m "Pull updates from ${REPO_TEMPLATE}"
popd
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

#Extra
.DS_Store

# Final Output
build/ProjectTemplate
2 changes: 2 additions & 0 deletions .idea/Project-Template.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions CITATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Asadzadeh"
given-names: "Kambiz"
orcid: "https://orcid.org/0009-0009-2065-3977"
title: "PT"
version: 1.1.222
date-released: 2023-04-25
url: "https://kambizasadzadeh.com"
repository-code: "https://github.com/genyleap/Project-Template"
Loading

0 comments on commit 805dd8b

Please sign in to comment.