[CI] Strip stored binaries (#8327)
authorAndres Noetzli <andres.noetzli@gmail.com>
Thu, 17 Mar 2022 00:12:09 +0000 (17:12 -0700)
committerGitHub <noreply@github.com>
Thu, 17 Mar 2022 00:12:09 +0000 (00:12 +0000)
This commit ensures that published binaries are stripped to make them
smaller. The stripping of the binaries is done before running the
regressions to make sure that the stripped binaries work as intended.
Stripping binaries decreases the executable size from about 28 MB to 24
MB.

.github/actions/configure-and-build/action.yml
.github/workflows/ci.yml

index 1f3ab5fc909cd0c74fbccc1ce931a5dd9a4bb1b9..314428d1b57ddf1d527a4d4bc92aeb5ee437a351 100644 (file)
@@ -11,6 +11,8 @@ inputs:
   build-static:
     default: true
     type: boolean
+  strip-bin:
+    default: ""
 outputs:
   shared-build-dir:
     description: build directory of the shared build
@@ -57,6 +59,10 @@ runs:
 
         make -j${{ env.num_proc }}
 
+        if [[ "${{ inputs.strip-bin }}" != "" ]]; then
+          ${{ inputs.strip-bin }} bin/cvc5*
+        fi
+
         echo "::set-output name=build-dir::$pwd"
         echo "::endgroup::"
         
index 7700bd50ec0cc373ce0414b1989d1742c65eecc3..3cc4fce34c3733e8ea9d7cbe2e2c3507af457128 100644 (file)
@@ -10,6 +10,7 @@ jobs:
             os: ubuntu-latest
             config: production --auto-download --all-bindings --editline --docs
             cache-key: production
+            strip-bin: strip
             python-bindings: true
             build-documentation: true
             check-examples: true
@@ -21,6 +22,7 @@ jobs:
             os: macos-11
             config: production --auto-download --python-bindings --editline
             cache-key: production
+            strip-bin: strip
             python-bindings: true
             check-examples: true
             store-to-release-name: cvc5-macOS
@@ -31,6 +33,7 @@ jobs:
             os: ubuntu-latest
             config: production --auto-download --win64
             cache-key: productionwin64
+            strip-bin: x86_64-w64-mingw32-strip
             windows-build: true
             store-to-release-name: cvc5-Win64.exe
             binary-ext: .exe
@@ -91,6 +94,7 @@ jobs:
         configure-config: ${{ matrix.config }}
         build-shared: ${{ matrix.build-shared }}
         build-static: ${{ matrix.build-static }}
+        strip-bin: ${{ matrix.strip-bin }}
 
     - name: ccache Statistics
       run: ccache -s