Skip to content

Commit

Permalink
fixing typo and improving cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
Ximaz committed May 2, 2024
1 parent ff43f14 commit 6929bfe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ name: "ci"

on:
- push
- pull_request

env:
UNIT_TESTS: "./unit_tests"
VALGRIND_REPORTS: "./valgrind-reports.log"
ARTIFACTS: "${{ vars.ARTIFACTS }}"
MIRROR_URL: "${{ vars.MIRROR_URL }}"
VALGRIND_SUPPRESSIONS: "${{ vars.VALGRIND_SUPPRESSIONS }}"
SSH_PRIVATE_KEY: "${{ secrets.SSH_PRIVATE_KEY }}"
SSH_PRIVATE_KEY_PASSPHRASE: "${{ secrets.SSH_PRIVATE_KEY_PASSPHRASE }}"

Expand Down Expand Up @@ -128,8 +130,11 @@ jobs:
timeout-minutes: 1
run: "[[ $(grep -E \"^tests_run:\" Makefile) == \"\" ]] && exit 0 || make tests_run"

- name: "Creating Valgrind suppression file"
run: "echo \"${{ env.VALGRIND_SUPPRESSIONS }}\" > valgrind.supp"

- name: "Run valgrind"
run: "[ -f \"${{ env.UNIT_TESTS }}\" ] && valgrind -s --leak-check=full --track-origins=yes --read-var-info=yes --trace-children=yes --show-leak-kinds=all --read-inline-info=yes --errors-for-leak-kinds=all ${{ env.UNIT_TESTS }} 2>${{ env.VALGRIND_REPORTS }}"
run: "[ -f \"${{ env.UNIT_TESTS }}\" ] && valgrind -s --leak-check=full --track-origins=yes --read-var-info=yes --trace-children=yes --show-leak-kinds=all --read-inline-info=yes --errors-for-leak-kinds=all --track-fds=yes --show-reachable=yes --gen-suppressions=all --suppressions=valgrind.supp ${{ env.UNIT_TESTS }} 2>${{ env.VALGRIND_REPORTS }}"

- name: "Analyze valgrind report"
run: |
Expand All @@ -148,6 +153,14 @@ jobs:
fi
if [[ $(echo "${line}" | grep '^==.*== .* bytes in .* blocks are definitely lost in loss record .* of .*$') ]]; then
block="${line}"
elif [[ $(echo "${line}" | grep '^==.*== .* bytes in .* blocks are still reachable in loss record .* of .*$') ]]; then
block="${line}"
elif [[ $(echo "${line}" | grep '^==.*== Invalid .* of size .*$') ]]; then
block="${line}"
elif [[ $(echo "${line}" | grep '^==.*== Open file descriptor .*: .*$') ]]; then
block="${line}"
elif [[ $(echo "${line}" | grep '^==.*== LEAK SUMMARY:.*$') ]]; then
block="${line}"
fi
done < ${{ env.VALGRIND_REPORTS }}
exit "${status}"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##
## EPITECH PROJECT, 2024
## List in C
## Hashmap in C
## File description:
## Makefile
##
Expand Down

0 comments on commit 6929bfe

Please sign in to comment.