Skip to content

Commit

Permalink
Add Norminette rule to Tests workflow + add CodeQL Analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
GogoVega committed May 4, 2024
1 parent 5a59809 commit 87c9a29
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
analyze:
name: Analyze
runs-on: macos-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: "c-cpp"

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:c-cpp"
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Tests

on:
push:
branches: [ "master" ]
paths-ignore: [ "docs/**" ]
pull_request:
branches: [ "master" ]

Expand All @@ -18,6 +18,10 @@ jobs:
- uses: actions/checkout@v4

- name: Run Build
run: make
run: make all

- name: Run Norminette
run: make norme

- name: Run Test
run: make test
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# By: gdandele <gdandele@student.s19.be> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/04/10 15:45:59 by gdandele #+# #+# #
# Updated: 2024/05/01 17:46:53 by gdandele ### ########.fr #
# Updated: 2024/05/04 13:37:21 by gdandele ### ########.fr #
# #
# **************************************************************************** #

Expand All @@ -28,9 +28,12 @@ ${NAME}: ${OBJS}
.c.o:
${CC} ${CCFLAGS} -I include -c $< -o $@

test:
test: all
bash test/script.sh

norme:
norminette -R CheckDefine src

clean:
rm -f ${OBJS}

Expand Down

0 comments on commit 87c9a29

Please sign in to comment.