mirror of
https://github.com/bkthomps/Containers.git
synced 2025-11-16 04:24:47 +00:00
Use GitHub actions as test suite (#91)
Use GitHub actions as a test suite. Can get rid of CircleCI, and now Valgrind is part of the test suite.
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
---
|
||||
version: 2
|
||||
jobs:
|
||||
build_and_test:
|
||||
docker:
|
||||
- image: rikorose/gcc-cmake:gcc-8
|
||||
steps:
|
||||
- checkout
|
||||
- run: cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" .
|
||||
- run: cmake --build . --target Containers -- -j 2
|
||||
- run: ./Containers
|
||||
- run: bash <(curl -s https://codecov.io/bash)
|
||||
workflows:
|
||||
version: 2
|
||||
build_and_test:
|
||||
jobs:
|
||||
- build_and_test
|
||||
@@ -1,3 +1,2 @@
|
||||
---
|
||||
ignore:
|
||||
- "tst"
|
||||
|
||||
28
.github/workflows/build.yml
vendored
Normal file
28
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: build
|
||||
on: [push]
|
||||
jobs:
|
||||
debug:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: make test_debug
|
||||
- run: ./ContainersTestDebug
|
||||
optimized:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: make test_optimized
|
||||
- run: ./ContainersTestOptimized
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: make test_coverage
|
||||
- run: ./ContainersTestCoverage
|
||||
- run: bash <(curl -s https://codecov.io/bash)
|
||||
valgrind:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: sudo apt install -y valgrind
|
||||
- run: make valgrind
|
||||
@@ -1,24 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.5.1)
|
||||
project(Containers C)
|
||||
|
||||
set(CMAKE_C_STANDARD 90)
|
||||
|
||||
set(CMAKE_C_FLAGS "-Wall -Wextra -Wpedantic -ldl -g -O0 -fprofile-arcs -ftest-coverage")
|
||||
|
||||
add_executable(Containers tst/test.c tst/test.h
|
||||
src/array.c src/include/array.h tst/array.c
|
||||
src/vector.c src/include/vector.h tst/vector.c
|
||||
src/deque.c src/include/deque.h tst/deque.c
|
||||
src/forward_list.c src/include/forward_list.h tst/forward_list.c
|
||||
src/list.c src/include/list.h tst/list.c
|
||||
src/set.c src/include/set.h tst/set.c
|
||||
src/map.c src/include/map.h tst/map.c
|
||||
src/multiset.c src/include/multiset.h tst/multiset.c
|
||||
src/multimap.c src/include/multimap.h tst/multimap.c
|
||||
src/unordered_set.c src/include/unordered_set.h tst/unordered_set.c
|
||||
src/unordered_map.c src/include/unordered_map.h tst/unordered_map.c
|
||||
src/unordered_multiset.c src/include/unordered_multiset.h tst/unordered_multiset.c
|
||||
src/unordered_multimap.c src/include/unordered_multimap.h tst/unordered_multimap.c
|
||||
src/stack.c src/include/stack.h tst/stack.c
|
||||
src/queue.c src/include/queue.h tst/queue.c
|
||||
src/priority_queue.c src/include/priority_queue.h tst/priority_queue.c)
|
||||
11
Makefile
11
Makefile
@@ -23,13 +23,16 @@ header:
|
||||
python3 compile_headers.py $(version)
|
||||
|
||||
test_debug:
|
||||
@clang src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -O0 -o ContainersTestDebug
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -o ContainersTestDebug
|
||||
|
||||
test_optimized:
|
||||
@clang src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -O3 -o ContainersTestOptimized
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O3 -ldl -o ContainersTestOptimized
|
||||
|
||||
test_coverage:
|
||||
@clang src/*.c tst/*.c -Wall -Wextra -Wpedantic -ldl -g -O0 -fprofile-arcs -ftest-coverage -o ContainersTestCoverage
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -g -coverage -o ContainersTestCoverage
|
||||
|
||||
valgrind:
|
||||
@valgrind --leak-check=yes ./ContainersTestDebug
|
||||
@sed -i 's/STUB_MALLOC 1/STUB_MALLOC 0/g' tst/test.h
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -o ContainersTestValgrind
|
||||
@sed -i 's/STUB_MALLOC 0/STUB_MALLOC 1/g' tst/test.h
|
||||
@valgrind --leak-check=full ./ContainersTestValgrind
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[](https://circleci.com/gh/bkthomps/Containers/tree/master)
|
||||
[](https://github.com/bkthomps/Containers)
|
||||
[](https://codedocs.xyz/bkthomps/Containers/)
|
||||
[](https://codecov.io/gh/bkthomps/Containers)
|
||||
[](https://frontend.code-inspector.com/project/12167/dashboard)
|
||||
[](https://en.wikipedia.org/wiki/C_(programming_language))
|
||||
[](https://github.com/bkthomps/Containers/blob/master/LICENSE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user