From 5bac2cbdb806e4555dbef5a7e27b0cfef779ed25 Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 25 Mar 2020 17:08:42 -0500 Subject: [PATCH] Add build test --- .travis.yml | 6 +++--- ci/build-test.sh | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100755 ci/build-test.sh diff --git a/.travis.yml b/.travis.yml index c99ede19..deecc893 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,12 +9,12 @@ jobs: - name: Linux Release if: tag IS present script: - - travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh" + - travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh && ./ci/build-test.sh" - ./ci/release-image/push.sh - name: Linux ARM64 Release if: tag IS present script: - - ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh" + - ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh && ./ci/build-test.sh" - ./ci/release-image/push.sh arch: arm64 - name: MacOS Release @@ -22,7 +22,7 @@ jobs: os: osx language: node_js node_js: 12 - script: yarn && yarn vscode && travis_wait 60 ci/release.sh + script: yarn && yarn vscode && travis_wait 60 ci/release.sh && ./ci/build-test.sh before_deploy: - echo "$JSON_KEY" | base64 --decode > ./ci/key.json diff --git a/ci/build-test.sh b/ci/build-test.sh new file mode 100755 index 00000000..804e22ea --- /dev/null +++ b/ci/build-test.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# build-test.bash -- Make sure the build worked. +# This is to make sure we don't have Node version errors or any other +# compilation-related errors. + +set -euo pipefail + +function main() { + cd "$(dirname "${0}")/.." || exit 1 + + local output + output=$(node ./build/out/node/entry.js --list-extensions 2>&1) + if echo "$output" | grep 'was compiled against a different Node.js version'; then + echo "$output" + exit 1 + else + echo "Build ran successfully" + fi +} + +main "$@"