diff --git a/cloudbuild.yml b/cloudbuild.yml index 4824a4906be..30c0ac949cc 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -22,6 +22,7 @@ steps: id: 'tfjs-core' args: ['./scripts/run-build.sh', 'tfjs-core'] waitFor: ['find-affected-packages'] + env: ['NIGHTLY=$_NIGHTLY'] # Converter. - name: 'gcr.io/cloud-builders/gcloud' diff --git a/scripts/run-build.sh b/scripts/run-build.sh index c5dabdf7595..118b9693830 100755 --- a/scripts/run-build.sh +++ b/scripts/run-build.sh @@ -17,6 +17,6 @@ set -e DIR=$1 -if test -f "$DIR/run-ci"; then +if [[ -f "$DIR/run-ci" || "$NIGHTLY" = true ]]; then gcloud builds submit . --config=$DIR/cloudbuild.yml fi diff --git a/tfjs-core/scripts/test-ci.sh b/tfjs-core/scripts/test-ci.sh index 67f51d33b5d..4f32b82f01b 100755 --- a/tfjs-core/scripts/test-ci.sh +++ b/tfjs-core/scripts/test-ci.sh @@ -20,21 +20,26 @@ yarn lint # Test in node (headless environment). yarn test-node-ci -# Run the first karma separately so it can download the BrowserStack binary -# without conflicting with others. -yarn run-browserstack --browsers=bs_safari_mac,bs_ios_11 --testEnv webgl1 --flags '{"WEBGL_CPU_FORWARD": false, "WEBGL_SIZE_UPLOAD_UNIFORM": 0}' +if [ "$NIGHTLY" = true ] +then + # Run the first karma separately so it can download the BrowserStack binary + # without conflicting with others. + yarn run-browserstack --browsers=bs_safari_mac,bs_ios_11 --testEnv webgl1 --flags '{"WEBGL_CPU_FORWARD": false, "WEBGL_SIZE_UPLOAD_UNIFORM": 0}' -# Run the rest of the karma tests in parallel. These runs will reuse the -# already downloaded binary. -npm-run-all -p -c --aggregate-output \ - "run-browserstack --browsers=bs_safari_mac,bs_ios_11,bs_android_9 --flags '{\"HAS_WEBGL\": false}' --testEnv cpu" \ - "run-browserstack --browsers=bs_firefox_mac,bs_chrome_mac" \ - "run-browserstack --browsers=bs_chrome_mac,win_10_chrome,bs_android_9 --testEnv webgl2 --flags '{\"WEBGL_CPU_FORWARD\": false, \"WEBGL_SIZE_UPLOAD_UNIFORM\": 0}'" \ - "run-browserstack --browsers=bs_chrome_mac --testEnv webgl2 --flags '{\"WEBGL_PACK\": false}'" \ + # Run the rest of the karma tests in parallel. These runs will reuse the + # already downloaded binary. + npm-run-all -p -c --aggregate-output \ + "run-browserstack --browsers=bs_safari_mac,bs_ios_11,bs_android_9 --flags '{\"HAS_WEBGL\": false}' --testEnv cpu" \ + "run-browserstack --browsers=bs_firefox_mac,bs_chrome_mac" \ + "run-browserstack --browsers=bs_chrome_mac,win_10_chrome,bs_android_9 --testEnv webgl2 --flags '{\"WEBGL_CPU_FORWARD\": false, \"WEBGL_SIZE_UPLOAD_UNIFORM\": 0}'" \ + "run-browserstack --browsers=bs_chrome_mac --testEnv webgl2 --flags '{\"WEBGL_PACK\": false}'" \ -### The next section tests TF.js in a webworker. -# Make a dist/tf-core.min.js file to be imported by the web worker. -yarn rollup -c --ci -# Safari doesn't have offscreen canvas so test cpu in a webworker. -# Chrome has offscreen canvas, so test webgl in a webworker. -yarn test-webworker --browsers=bs_safari_mac,bs_chrome_mac + ### The next section tests TF.js in a webworker. + # Make a dist/tf-core.min.js file to be imported by the web worker. + yarn rollup -c --ci + # Safari doesn't have offscreen canvas so test cpu in a webworker. + # Chrome has offscreen canvas, so test webgl in a webworker. + yarn test-webworker --browsers=bs_safari_mac,bs_chrome_mac +else + yarn run-browserstack --browsers=bs_chrome_mac +fi