chore: Attempt to cache gocr

main
Sean McBride 4 years ago
parent 199449a2bc
commit bfe0823c81

@ -92,6 +92,14 @@ jobs:
LD_LIBRARY_PATH="$(pwd)/lib:$LD_LIBRARY_PATH" LD_LIBRARY_PATH="$(pwd)/lib:$LD_LIBRARY_PATH"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
make build-validate make build-validate
- name: Cache gocr
uses: actions/cache@v2
env:
cache-name: gocr
with:
# Cache the gocr webassembly module based on the submodule file
path: ./runtime/bin/gocr_wasm.so
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles(./runtime/tests/gocr') }}
- name: Compile sample apps and run tests - name: Compile sample apps and run tests
run: | run: |
./test.sh ./test.sh

@ -32,7 +32,9 @@ declare -a failed_tests=()
# OCR Tests # OCR Tests
# FIXME: OCR tests seem to sporadically fail and then work on rerun. # FIXME: OCR tests seem to sporadically fail and then work on rerun.
ocr_hyde() { ocr_hyde() {
if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then
make gocr -C "$base_dir/runtime/tests" || exit 1 make gocr -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ocr/hyde" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/hyde" || exit 1
./run.sh || failed_tests+=("ocr_hyde") ./run.sh || failed_tests+=("ocr_hyde")
popd || exit 1 popd || exit 1
@ -40,7 +42,9 @@ ocr_hyde() {
} }
ocr_handwriting() { ocr_handwriting() {
if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then
make gocr -C "$base_dir/runtime/tests" || exit 1 make gocr -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ocr/handwriting" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/handwriting" || exit 1
./run.sh || failed_tests+=("ocr_handwriting") ./run.sh || failed_tests+=("ocr_handwriting")
popd || exit 1 popd || exit 1
@ -48,7 +52,9 @@ ocr_handwriting() {
} }
ocr_fivebyeight() { ocr_fivebyeight() {
if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then
make gocr -C "$base_dir/runtime/tests" || exit 1 make gocr -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ocr/fivebyeight" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/fivebyeight" || exit 1
./run.sh || failed_tests+=("ocr_fivebyeight") ./run.sh || failed_tests+=("ocr_fivebyeight")
popd || exit 1 popd || exit 1
@ -56,7 +62,9 @@ ocr_fivebyeight() {
} }
ocr_by_word() { ocr_by_word() {
if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then
make gocr -C "$base_dir/runtime/tests" || exit 1 make gocr -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ocr/by_word" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/by_word" || exit 1
./install.sh || exit 1 ./install.sh || exit 1
./run.sh || failed_tests+=("ocr_by_word") ./run.sh || failed_tests+=("ocr_by_word")
@ -65,7 +73,9 @@ ocr_by_word() {
} }
ocr_by_font() { ocr_by_font() {
if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then
make gocr -C "$base_dir/runtime/tests" || exit 1 make gocr -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ocr/by_font" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/by_font" || exit 1
./install.sh || exit 1 ./install.sh || exit 1
./run.sh || failed_tests+=("ocr_by_font") ./run.sh || failed_tests+=("ocr_by_font")
@ -74,7 +84,9 @@ ocr_by_font() {
} }
ocr_by_dpi() { ocr_by_dpi() {
if [[ ! -f "$base_dir/runtime/bin/gocr_wasm.so" ]]; then
make gocr -C "$base_dir/runtime/tests" || exit 1 make gocr -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ocr/by_dpi" || exit 1 pushd "$base_dir/runtime/experiments/applications/ocr/by_dpi" || exit 1
./install.sh || exit 1 ./install.sh || exit 1
./run.sh || failed_tests+=("ocr_by_dpi") ./run.sh || failed_tests+=("ocr_by_dpi")

Loading…
Cancel
Save