-
Notifications
You must be signed in to change notification settings - Fork 2
29 lines (27 loc) · 1.13 KB
/
main_valgrind.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: main-valgrind
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache gtest library
uses: actions/cache@v2
env:
cache-name: cache-gtest-lib
with:
key: $${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/usr/local/lib/libgtest.a') }}
path: /usr/local/lib/libgtest.a
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install gtest manually
run: sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake CMakeLists.txt && sudo make && sudo cp lib/*.a /usr/lib && sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a && sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a
- name: Install valgrind
run: sudo apt-get install -y valgrind
- name: Check out the code
uses: actions/checkout@v2
- name: Compile code
run: gcc -Wall -g -o check_whitespace check_whitespace.c main.c
- name: Run test
run: valgrind -v --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./check_whitespace < main.c