Skip to content

Commit

Permalink
Add formatting check to continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
uyjulian committed Jul 8, 2020
1 parent f4c59c6 commit 953f535
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
pull_request:
repository_dispatch:
types: [run_build]

jobs:
check-format:
runs-on: ubuntu-latest
container: ps2dev/ps2dev:latest
steps:
- name: Install dependencies
run: |
apk add git make clang
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- name: Check format -> make format-check
run: |
make format-check
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ EE_OBJS := $(EE_OBJS:%=$(EE_OBJS_DIR)%)

.SILENT:

.PHONY: all release debug iopcore_debug eesio_debug ingame_debug deci2_debug clean rebuild pc_tools pc_tools_win32 oplversion format
.PHONY: all release debug iopcore_debug eesio_debug ingame_debug deci2_debug clean rebuild pc_tools pc_tools_win32 oplversion format format-check

all:
echo "Building Open PS2 Loader $(OPL_VERSION)..."
Expand Down Expand Up @@ -315,6 +315,9 @@ pc_tools_win32:
format:
find . -type f -not -path \*modules/network/SMSTCPIP\* -a \( -iname \*.h -o -iname \*.c \) | xargs clang-format -i

format-check:
@! find . -type f -not -path \*modules/network/SMSTCPIP\* -a \( -iname \*.h -o -iname \*.c \) | xargs clang-format -style=file -output-replacements-xml | grep "<replacement " >/dev/null

$(EE_ASM_DIR):
@mkdir -p $@

Expand Down

0 comments on commit 953f535

Please sign in to comment.