]> Sergey Matveev's repositories - nnn.git/commitdiff
improve patch conflict ci script
authorN-R-K <nrk@disroot.org>
Mon, 30 May 2022 11:37:57 +0000 (11:37 +0000)
committerNRK <nrk@disroot.org>
Mon, 30 May 2022 11:43:41 +0000 (17:43 +0600)
goes through all different combinations automatically and makes adding
another patch easier by simply putting the name into the patches array.

.github/workflows/ci.yml

index 9394e0c6cb4808362468f2aaacf46c293b7f5de8..57295188c8105730bf16aa83610d268dbd1dbdec 100644 (file)
@@ -43,26 +43,12 @@ jobs:
         env:
           CC: gcc
         run: |
-          export CFLAGS="$CFLAGS -Werror"
-          make clean
-          echo "########## O_NAMEFIRST=1 ##########"
-          make O_NAMEFIRST=1
-          make clean
-          echo "########## O_GITSTATUS=1 ##########"
-          make O_GITSTATUS=1
-          make clean
-          echo "########## O_RESTOREPREVIEW=1 ##########"
-          make O_RESTOREPREVIEW=1
-          make clean
-          echo "########## O_NAMEFIRST=1 O_GITSTATUS=1 ##########"
-          make O_NAMEFIRST=1 O_GITSTATUS=1
-          make clean
-          echo "########## O_NAMEFIRST=1 O_RESTOREPREVIEW=1 ##########"
-          make O_NAMEFIRST=1 O_RESTOREPREVIEW=1
-          make clean
-          echo "########## O_GITSTATUS=1 O_RESTOREPREVIEW=1 ##########"
-          make O_GITSTATUS=1 O_RESTOREPREVIEW=1
-          make clean
-          echo "########## O_NAMEFIRST=1 O_GITSTATUS=1 O_RESTOREPREVIEW=1 ##########"
-          make O_NAMEFIRST=1 O_GITSTATUS=1 O_RESTOREPREVIEW=1
-          make clean
+          patches=("O_GITSTATUS" "O_NAMEFIRST" "O_RESTOREPREVIEW")
+          z=$(( 1 << ${#patches[@]} ))
+          for ((n=1; n < z; ++n)); do
+            for ((i=0; i < ${#patches[@]}; ++i)); do
+              printf "%s=%d " "${patches[$i]}" "$(( (n & (1 << i)) != 0 ))"
+            done | tee "tmp" ; echo
+            make clean
+            xargs make <"tmp"
+          done