Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cloudbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
37 changes: 21 additions & 16 deletions tfjs-core/scripts/test-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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