Skip to content

Commit

Permalink
CI/CD: clang-format and make
Browse files Browse the repository at this point in the history
Use Github actions to automatically test compile and check code formatting for every pull requests and pushes.

Signed-off-by: Cheng Ho Ming <eric310@connect.hku.hk>
  • Loading branch information
eric15342335 committed Mar 27, 2024
1 parent a0a5164 commit e19de34
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: clang-format

on: [push, pull_request]

jobs:
cpp-formatting-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- uses: actions/checkout@v3
- name: Run clang-format
run: |
clang-format --dry-run -style=google $(find . -name '*.cpp' -or -name '*.h')
23 changes: 23 additions & 0 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Make

on: [push, pull_request]

jobs:
Make:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Make
run: |
make clean
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

0 comments on commit e19de34

Please sign in to comment.