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)