diff --git a/.travis.yml b/.travis.yml index c99ede190..deecc8937 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 000000000..804e22ea6 --- /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 "$@"