-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
93 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
Standard: Cpp11 | ||
Language: Cpp | ||
|
||
UseTab: Never | ||
IndentWidth: 4 | ||
TabWidth: 4 | ||
IndentAccessModifiers: true | ||
|
||
ColumnLimit: 0 | ||
|
||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
BeforeElse: True | ||
|
||
DerivePointerAlignment: false | ||
PointerAlignment: Middle | ||
|
||
IncludeBlocks: Preserve | ||
SortIncludes: Never | ||
|
||
ReflowComments: 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,17 @@ | ||
name: clang-format | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
clang-format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run clang-format | ||
run: | | ||
clang-format --Werror --dry-run *.cpp *.h |
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,28 @@ | ||
"Commented out since our Makefile is empty" | ||
"""name: Make | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
Make: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Make | ||
run: | | ||
make | ||
- name: Upload executable | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
# suppose we compiled our game and named it 'stocksim' | ||
name: stocksim | ||
path: stocksim | ||
compression-level: 9 | ||
retention-days: 90 | ||
if-no-files-found: error | ||
""" |
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 @@ | ||
name: clang-format pull request | ||
|
||
on: | ||
[workflow_dispatch] | ||
|
||
jobs: | ||
clang-format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Create pull request | ||
run: | | ||
rand_char=$(openssl rand -hex 3) | ||
git checkout -b clang-format-$rand_char | ||
clang-format -i *.cpp *.h | ||
git add --all | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git commit -m "Format: Run clang-format on main branch" | ||
git push -u origin clang-format-$rand_char | ||
gh pr create -B main -H clang-format-$rand_char --title 'Format: Run clang-format on main branch' --body "This pull request fixes formatting issues in the codebase using .clang-format configuration file. Created by Github Actions" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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