2020-12-07 12:26:52 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-12-13 04:12:59 +01:00
|
|
|
STATE=$(pwd)/../state/anki-ci
|
|
|
|
mkdir -p $STATE
|
|
|
|
BAZEL="bazel --output_user_root=$STATE/bazel --output_base=$STATE/bazel/anki"
|
2020-12-07 12:26:52 +01:00
|
|
|
BUILDARGS="--config=ci --experimental_convenience_symlinks=ignore"
|
|
|
|
|
2021-12-09 09:55:19 +01:00
|
|
|
echo "+++ Building and testing"
|
|
|
|
|
2020-12-07 12:26:52 +01:00
|
|
|
# move existing node_modules into tree
|
2021-12-13 04:12:59 +01:00
|
|
|
test -e $STATE/node_modules && mv $STATE/node_modules .
|
2020-12-07 12:26:52 +01:00
|
|
|
|
|
|
|
$BAZEL test $BUILDARGS ...
|
|
|
|
|
2022-01-23 09:47:39 +01:00
|
|
|
echo "--- Building wheels"
|
|
|
|
$BAZEL build dist
|
|
|
|
|
2020-12-07 12:26:52 +01:00
|
|
|
# if tests succeed, back up node_modules folder
|
2021-12-13 04:12:59 +01:00
|
|
|
mv node_modules $STATE/
|