From 86c37f53d9fde45d4988f94bc38858d7ec793949 Mon Sep 17 00:00:00 2001 From: surtur Date: Sun, 24 Oct 2021 21:35:57 +0200 Subject: [PATCH] ci: add {cppcheck,valgrind} steps --- .drone.starlark | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/.drone.starlark b/.drone.starlark index 1006957..7f61ac9 100644 --- a/.drone.starlark +++ b/.drone.starlark @@ -5,11 +5,23 @@ def main(ctx): "type": "docker", "name": "testing", "steps": [ + { + "name": "cppcheck", + "image": "docker.io/archlinux:base-devel", + "pull": "always", + "depends_on": ["clone"], + "commands": [ + "pacman -Sy cppcheck --noconfirm --needed", + "uname -r", + "cppcheck --version", + "cppcheck --enable=all ./*.cpp ./*.h" + ] + }, { "name": "build debug", "image": "docker.io/immawanderer/fedora-cpp:linux-amd64", "pull": "always", - "depends_on": ["clone"], + "depends_on": ["cppcheck"], "commands": [ "uname -r", "mkdir -pv debug", @@ -21,7 +33,7 @@ def main(ctx): "name": "build release", "image": "docker.io/immawanderer/fedora-cpp:linux-amd64", "pull": "always", - "depends_on": ["clone"], + "depends_on": ["cppcheck"], "commands": [ "uname -r", "mkdir -pv release", @@ -33,7 +45,7 @@ def main(ctx): "name": "build on alpine", "image": "docker.io/alpine:3.14", "pull": "always", - "depends_on": ["clone"], + "depends_on": ["cppcheck"], "commands": [ "uname -r", "apk add --no-cache gcc g++ cmake ninja --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing", @@ -42,6 +54,30 @@ def main(ctx): "cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -B debug-alpine", "ninja -C debug-alpine && ls -lah ./debug-alpine && ./debug-alpine/fortuna" + "||" + "true" ] + }, + { + "name": "valgrind debug", + "image": "docker.io/archlinux:base-devel", + "pull": "always", + "depends_on": ["build debug"], + "commands": [ + "uname -r", + "pacman -Sy valgrind --noconfirm --needed", + "valgrind --version", + "valgrind ./debug/fortuna" + ] + }, + { + "name": "valgrind release", + "image": "docker.io/archlinux:base-devel", + "pull": "always", + "depends_on": ["build release"], + "commands": [ + "uname -r", + "pacman -Sy valgrind --noconfirm --needed", + "valgrind --version", + "valgrind ./release/fortuna" + ] } ] }