Skip to content

Commit b47fcf9

Browse files
committed
fix: add check-directives to CI
1 parent b8a3c6c commit b47fcf9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,30 @@ on:
2121
- "docs/*"
2222

2323
jobs:
24+
check-directives:
25+
name: Check Preprocessor Directives
26+
runs-on: ubuntu-latest
27+
env:
28+
HEADER_FILE: src/NetWizard.h
29+
steps:
30+
- name: Checkout Repository
31+
uses: actions/checkout@v4
32+
- name: Check NETWIZARD_USE_ASYNC_WEBSERVER
33+
env:
34+
DIRECTIVE: NETWIZARD_USE_ASYNC_WEBSERVER
35+
EXPECTED_VALUE: 0
36+
run: |
37+
if [ ! -f "$HEADER_FILE" ]; then
38+
echo "$HEADER_FILE not found!" && exit 1
39+
fi
40+
if ! grep -Eq "#define[[:space:]]+$DIRECTIVE[[:space:]]+$EXPECTED_VALUE([[:space:]]+|$)" "$HEADER_FILE"; then
41+
echo "$DIRECTIVE is not set to $EXPECTED_VALUE!" && exit 1
42+
fi
43+
echo "Preprocessor directive is correctly set to $EXPECTED_VALUE."
44+
2445
arduino:
2546
name: Arduino - ${{ matrix.name }}
47+
needs: check-directives
2648
runs-on: ubuntu-latest
2749
strategy:
2850
fail-fast: false
@@ -106,6 +128,7 @@ jobs:
106128

107129
platformio:
108130
name: PlatformIO - ${{ matrix.name }}
131+
needs: check-directives
109132
runs-on: ubuntu-latest
110133
strategy:
111134
fail-fast: false

0 commit comments

Comments
 (0)