This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
Added Valgrind to Action #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
Run-Tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Build Dependencies | |
run: sudo apt-get update && sudo apt-get install -y build-essential python-is-python3 pip valgrind | |
- name: Install Python Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
pip install lizard | |
- name: Build with GCC | |
run: gcc -o project *.c | |
- name: Copy bin file to dir | |
run: cp ./project ./tests/ | |
- name: Give the script permission to run | |
run: chmod +x run-valgrind.sh | |
working-directory: ./tests | |
- name: Run Public Tests | |
run: make | |
working-directory: ./tests/public-tests | |
- name: Run Private Tests | |
run: make | |
working-directory: ./tests/private-tests | |
- name: Run Valgrind on Private Tests | |
run: ./run-valgrind.sh | |
working-directory: ./tests | |
- name: Upload Public Tests log | |
uses: actions/upload-artifact@v4 | |
with: | |
name: public_tests_log | |
path: ./tests/public-tests/public-tests.log | |
- name: Upload Private Tests log | |
uses: actions/upload-artifact@v4 | |
with: | |
name: private_tests_log | |
path: ./tests/private-tests/private-tests.log | |
- name: Upload Valgrind log | |
uses: actions/upload-artifact@v4 | |
with: | |
name: valgrind_log | |
path: ./tests/valgrind.log | |
- name: Run Lizard | |
run: lizard -L 50 -T nloc=30 -C 15 -m *.c | |
working-directory: ./ | |