aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2024-02-26 22:11:13 +0100
committerRobin Jarry <robin@jarry.cc>2024-03-04 22:30:01 +0100
commit963633eb83dc19089236ac78ba9d823e7e2a6df9 (patch)
tree042172178e6b1388efada29315201fcc559fb7f9
parent65571b67d7d310089e40d13f26b06cfcb85465bb (diff)
downloadaerc-963633eb83dc19089236ac78ba9d823e7e2a6df9.tar.gz
aerc-963633eb83dc19089236ac78ba9d823e7e2a6df9.zip
mk: add validate target
Instead of hiding the actual checks deep into the CI framework and into the sendemail-validate hook, add a validate make target that uses proper variables and runs the required checks. Use it in the sendemail-validate hook and the CI builds. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
-rw-r--r--.builds/alpine-edge.yml11
-rw-r--r--GNUmakefile4
-rwxr-xr-xcontrib/sendemail-validate4
3 files changed, 7 insertions, 12 deletions
diff --git a/.builds/alpine-edge.yml b/.builds/alpine-edge.yml
index a32d37a6..f6bc9701 100644
--- a/.builds/alpine-edge.yml
+++ b/.builds/alpine-edge.yml
@@ -13,20 +13,13 @@ environment:
DESTDIR: ./out
GOFLAGS: "-tags=notmuch"
CC: gcc
- CFLAGS: -O0 -g -std=c99 -Wall -Wextra -Wconversion -Werror -Wformat-security -Wstack-protector -Wpedantic -Wmissing-prototypes
FILTERS_TEST_PREFIX: valgrind --leak-check=full --error-exitcode=1
tasks:
- - build: |
- gmake -C aerc
+ - validate: |
+ gmake -C aerc validate
- install: |
gmake -C aerc install checkinstall
- - test: |
- gmake -C aerc tests
- - lint: |
- gmake -C aerc lint
- ancient-go-version: |
curl -O https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/go-1.18.7-r0.apk
sudo apk add ./go-1.18.7-r0.apk
gmake -C aerc clean all
- - check-patches: |
- gmake -C aerc check-patches
diff --git a/GNUmakefile b/GNUmakefile
index 34e1a592..02e7b612 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -128,6 +128,10 @@ gitconfig:
check-patches:
@contrib/check-patches origin/master..
+.PHONY: validate
+validate: CFLAGS = -Wall -Wextra -Wconversion -Werror -Wformat-security -Wstack-protector -Wpedantic -Wmissing-prototypes
+validate: all tests lint check-patches
+
# Generate build and install rules for one man page
#
# $1: man page name (e.g: aerc.1)
diff --git a/contrib/sendemail-validate b/contrib/sendemail-validate
index ae29d05c..8f0af2d5 100755
--- a/contrib/sendemail-validate
+++ b/contrib/sendemail-validate
@@ -30,11 +30,9 @@ validate_patch () {
git am -3 "$file"
}
-export CFLAGS="-O0 -g -std=c99 -Wall -Wextra -Wconversion -Werror -Wformat-security -Wstack-protector -Wpedantic -Wmissing-prototypes"
-
validate_series () {
command -v gmake >/dev/null 2>&1 && make="gmake" || make="make"
- $make all tests lint check-patches
+ $make validate
}
# main -------------------------------------------------------------------------