From 86097693890af2d5d555f57bc779dc768d12ec55 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sun, 22 Jan 2023 12:17:56 +0100 Subject: [PATCH] chore: better separate ci jobs --- .woodpecker/lint.yml | 15 +++++++++++++++ .woodpecker/test-mem.yml | 18 ++++++++++++++++++ .woodpecker.yml => .woodpecker/test.yml | 9 +-------- Makefile | 5 +++++ 4 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 .woodpecker/lint.yml create mode 100644 .woodpecker/test-mem.yml rename .woodpecker.yml => .woodpecker/test.yml (81%) diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml new file mode 100644 index 0000000..7c0f90e --- /dev/null +++ b/.woodpecker/lint.yml @@ -0,0 +1,15 @@ +variables: + &image 'git.rustybever.be/chewing_bever/c-devop:alpine3.17' + +branches: + exclude: [ main ] +platform: linux/amd64 + +pipeline: + lint: + image: *image + pull: true + commands: + - make lint + when: + event: [push, pull_request] diff --git a/.woodpecker/test-mem.yml b/.woodpecker/test-mem.yml new file mode 100644 index 0000000..a9ce77b --- /dev/null +++ b/.woodpecker/test-mem.yml @@ -0,0 +1,18 @@ +variables: + &image 'git.rustybever.be/chewing_bever/c-devop:alpine3.17' + +branches: + exclude: [ main ] +platform: linux/amd64 + +depends_on: + - test + +pipeline: + test: + image: *image + pull: true + commands: + - make test-mem + when: + event: [push, pull_request] diff --git a/.woodpecker.yml b/.woodpecker/test.yml similarity index 81% rename from .woodpecker.yml rename to .woodpecker/test.yml index a7e8fe3..6f636ca 100644 --- a/.woodpecker.yml +++ b/.woodpecker/test.yml @@ -11,16 +11,9 @@ branches: platform: ${PLATFORM} pipeline: - lint: - image: *image - pull: true - commands: - - make lint - when: - event: [push, pull_request] - build: image: *image + pull: true commands: - make - make clean diff --git a/Makefile b/Makefile index 30b6a31..777d356 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,11 @@ $(BUILD_DIR)/$(SRC_DIR)/%.c.o: $(SRC_DIR)/%.c test: build-test @ $(foreach bin,$(BINS_TEST),./$(bin);) +.PHONY: test-mem +test-mem: build-test + @ $(foreach bin,$(BINS_TEST),valgrind --tool=memcheck --error-exitcode=1 \ + --track-origins=yes --leak-check=full ./$(bin);) + .PHONY: build-test build-test: $(BINS_TEST)