Skip to content

Commit

Permalink
Merge pull request #25 from X-R-G-B/dev
Browse files Browse the repository at this point in the history
Dev -> Main
  • Loading branch information
TTENSHII authored Sep 30, 2023
2 parents a4e7a88 + f2cd9b3 commit 2d4d612
Show file tree
Hide file tree
Showing 187 changed files with 3,896 additions and 555 deletions.
100 changes: 100 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Language: Cpp
ColumnLimit: '80'
ReflowComments: true
AlignAfterOpenBracket: AlwaysBreak
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
EmptyLineBeforeAccessModifier: Always
IndentWrappedFunctionNames: 'false'
AccessModifierOffset: 0
IndentAccessModifiers: true
BinPackParameters: false
BinPackArguments: false
InsertTrailingCommas: Wrapped
PackConstructorInitializers: CurrentLine
AlwaysBreakTemplateDeclarations: Yes
DerivePointerAlignment: true
LambdaBodyIndentation: Signature
AlignOperands: false
BreakBeforeBraces: Custom

BraceWrapping:
AfterCaseLabel: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true

AlwaysBreakAfterReturnType: None

TabWidth: '4'
UseTab: Never
IndentPPDirectives: BeforeHash
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignArrayOfStructures: 'Left'
Cpp11BracedListStyle: true
PointerAlignment: Right
ReferenceAlignment: Right
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: 'false'
SpacesInAngles: false
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
SpacesInContainerLiterals: 'false'
SpaceAfterTemplateKeyword: 'true'
IndentCaseLabels: 'true'
NamespaceIndentation: All
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: 'false'
AllowShortBlocksOnASingleLine: 'true'
AllowShortCaseLabelsOnASingleLine: 'true'
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignTrailingComments: true
BreakStringLiterals: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
SortIncludes: true
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '<.+>' # System/Standard libs
Priority: 1
- Regex: '"raylib.h"' # Criterion headers
Priority: 2
- Regex: '"raylib-cpp.hpp"' # Criterion headers
Priority: 2
- Regex: '".+"' # Any "my_header.h"
Priority: 3

# Sort 'using' declarations
SortUsingDeclarations: true

BasedOnStyle: LLVM
AlwaysBreakBeforeMultilineStrings: 'true'
ContinuationIndentWidth: '4'
SpaceInEmptyBlock: true
IndentWidth: '4'
PenaltyBreakAssignment: '0'
SpaceBeforeCpp11BracedList: 'true'
SpaceBeforeRangeBasedForLoopColon: 'true'

# To totally disable format
DisableFormat: 'false'
5 changes: 5 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,modernize-*,portability-*,readability-*,-readability-identifier-length,-modernize-use-trailing-return-type'
WarningsAsErrors: '-*,clang-diagnostic-*,clang-analyzer-*,-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,modernize-*,portability-*,readability-*,-readability-identifier-length,-modernize-use-trailing-return-type'
HeaderFilterRegex: '(src/ECS/)|(src/Client/)|(src/Server/)'
AnalyzeTemporaryDtors: false
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 4
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# All files are checked into the repo with LF
* text=auto

# These files are checked out using CRLF locally
*.bat eol=crlf
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contact_links:
- name: Question/s
url: https://github.com/X-R-G-B/R-Bus/discussions/categories/q-a
about: If you have question/s to ask you can find your answer.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/install-failed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Install Failed"
description: "When you can't install or have error when installing"
title: "[FAIL INSTALL] - Title"
labels: [
"bug"
]
body:
- type: textarea
id: os
attributes:
label: "Operating System"
description: "What operating system do you use"
validations:
required: true
- type: textarea
id: error
attributes:
label: "Errors"
description: "Errors"
validations:
required: true
- type: textarea
id: step
attributes:
label: "Steps"
description: "Steps to reproduce"
validations:
required: true
79 changes: 79 additions & 0 deletions .github/workflows/compil.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Compil

on: [push, pull_request]

jobs:
compil-check-job-run:
runs-on: ubuntu-latest

outputs:
workflows: ${{ steps.filter.outputs.workflows }}
src: ${{ steps.filter.outputs.src }}
cmake: ${{ steps.filter.outputs.cmake }}
combined: ${{ steps.filter.outputs.workflows == 'true' || steps.filter.outputs.src == 'true' || steps.filter.outputs.cmake == 'true' }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check modified files need re run
id: filter
uses: dorny/paths-filter@v2
with:
filters: |
workflows:
- '.github/workflows/**'
src:
- 'src/**'
cmake:
- 'CMakeLists.txt'
windows-compil:
runs-on: windows-latest
needs: [compil-check-job-run]
if: needs.compil-check-job-run.outputs.combined || github.event_name == 'pull_request'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install winget
uses: Cyberboss/install-winget@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: ./scripts/install-deps-windows.ps1

- name: Compil
run: ./scripts/compil.ps1 --dry-run

linux-compil:
runs-on: ubuntu-latest
needs: [compil-check-job-run]
if: needs.compil-check-job-run.outputs.combined || github.event_name == 'pull_request'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: sudo ./scripts/install-deps-linux.sh

- name: Compil
run: ./scripts/compil.sh --dry-run

macos-compil:
runs-on: macos-latest
needs: [compil-check-job-run]
if: needs.compil-check-job-run.outputs.combined || github.event_name == 'pull_request'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: ./scripts/install-deps-macos.sh

- name: Compil
run: ./scripts/compil.sh --dry-run
55 changes: 55 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Documentation
on: [push]

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check modified files need re run
id: filter
uses: dorny/paths-filter@v2
with:
filters: |
docs:
- 'docs/**'
docs2:
- 'book.toml'
- name: Install latest mdbook
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.docs2 == 'true' || github.ref == 'refs/heads/main'
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.docs2 == 'true' || github.ref == 'refs/heads/main'
run: mdbook build

- name: Setup Pages
if: github.ref == 'refs/heads/main'
uses: actions/configure-pages@v3

- name: Upload artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: 'book'

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v2
74 changes: 74 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Format

on: [push, pull_request]

jobs:
# windows-format:
# runs-on: windows-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Install winget
# uses: Cyberboss/install-winget@v1
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Install dependencies
# run: ./scripts/install-deps-windows.ps1
#
# - name: Format
# run: ./scripts/format.ps1 --dry-run
#
# linux-format:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Install dependencies
# run: sudo ./scripts/install-deps-linux.sh
#
# - name: Format
# run: ./scripts/format.sh --dry-run
#
# macos-format:
# runs-on: macos-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Install dependencies
# run: ./scripts/install-deps-macos.sh
#
# - name: Format
# run: ./scripts/format.sh --dry-run

auto-format:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request' }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Install dependencies
run: sudo ./scripts/install-deps-linux.sh

- name: Format
run: ./scripts/format.sh

- name: Check for modified files
id: git-check
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT

- name: Push changes
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'Github Actions'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git commit -am "FORMAT-AUTO: automatic format on pull request #${{ github.event.number }}"
git push
2 changes: 1 addition & 1 deletion .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Publish

on: [push, pull_request]
on: [push]

env:
MIRROR_URL: [email protected]:EpitechPromo2026/B-CPP-500-TLS-5-1-rtype-xavier.mitault.git
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
# Release script run in Github CI

BRANCH="$1"

LAST_TAG=$(git describe --tags --abbrev=0)
LAST_TAG=$(git tag | sort -t '.' --numeric-sort -k1,1 -k2,2 -k3,3 | tail -n 1)
LAST_TAG_MAJOR=$(echo "$LAST_TAG" | cut -d'.' -f1)
LAST_TAG_MINOR=$(echo "$LAST_TAG" | cut -d'.' -f2)
LAST_TAG_PATCH=$(echo "$LAST_TAG" | cut -d'.' -f3)
Expand Down Expand Up @@ -39,7 +40,7 @@ TAG="$TAG_MAJOR.$TAG_MINOR.$TAG_PATCH"
gh release create "$TAG" \
--title "v$TAG" \
--generate-notes \
--target main
--target "$BRANCH"

echo "release_tag=$TAG" >> $GITHUB_OUTPUT
echo "$WARNINGS"
Loading

0 comments on commit 2d4d612

Please sign in to comment.