Skip to content

Commit

Permalink
Add test stage to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zinccyy committed Dec 14, 2022
1 parent faa6f67 commit cc51386
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ variables:

stages:
- build
- test

# install libraries
before_script:
Expand All @@ -27,7 +28,7 @@ build:default:

script:
- mkdir build
- cmake -S . -B build/ -DSYSTEMD_IFINDEX=1 -DCMAKE_C_COMPILER=clang
- cmake -S . -B build/ -DSYSTEMD_IFINDEX=1 -DENABLE_BUILD_TESTS=ON -DCMAKE_C_COMPILER=clang
- cmake --build build/

artifacts:
Expand All @@ -39,7 +40,7 @@ build:sanitized:

script:
- mkdir build-sanitized
- cmake -S . -B build-sanitized/ -DSYSTEMD_IFINDEX=1 -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS=\"-fsanitize=address,undefined\" -DENABLE_SANITIZER=ON
- cmake -S . -B build-sanitized/ -DSYSTEMD_IFINDEX=1 -DENABLE_BUILD_TESTS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS=\"-fsanitize=address,undefined\" -DENABLE_SANITIZER=ON
- cmake --build build-sanitized/
artifacts:
paths:
Expand All @@ -50,8 +51,18 @@ build:sanitized_memory:

script:
- mkdir build-sanitized-memory
- cmake -S . -B build-sanitized-memory/ -DSYSTEMD_IFINDEX=1 -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS=\"-fsanitize=memory\" -DENABLE_SANITIZER=ON
- cmake -S . -B build-sanitized-memory/ -DSYSTEMD_IFINDEX=1 -DENABLE_BUILD_TESTS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS=\"-fsanitize=memory\" -DENABLE_SANITIZER=ON
- cmake --build build-sanitized-memory/
artifacts:
paths:
- build-sanitized-memory/
- build-sanitized-memory/

test:default:
stage: test
needs: ["build:default"]
script:
- cd build
- ctest
artifacts:
paths:
- build/

0 comments on commit cc51386

Please sign in to comment.