Skip to content

update libocr

update libocr #2096

Workflow file for this run

name: PKG Build and Test
on: [push ]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Build
run: go build -v ./...
- name: Unit Tests
run: go test -race ./... -coverpkg=./... -coverprofile=pkg_coverage.out
- name: Fuzz Tests
# the amount of --seconds here is subject to change based on how long the CI job takes in the future
# as we add more fuzz tests, we should take into consideration increasing this timelapse, so we can have enough coverage.
# We are timing out after ~10mins in case the tests hang. (Current CI duration is ~7m, modify if needed)
# See https://github.com/golang/go/issues/52569 there's a bug that causes fuzz tests to fail if they run too long.
# 12s was working for a long time in core, and always ran successfully for > 12 s for this repo before failing too.
# Note: Users in a linked issue said that it took hours to fail on a mac, vs seconds or minutes on linux.
run: cd fuzz && timeout 10m ./fuzz_all_native.py --ci --seconds 12
- name: Log Fuzz Tests Failing Inputs
if: failure()
run: find . -type f|fgrep '/testdata/fuzz/'|while read f; do echo $f; cat $f; done
- name: Upload Fuzz Tests Failing Inputs
if: failure()
uses: actions/upload-artifact@v3
with:
name: failing-fuzz-inputs
path: '**/testdata/fuzz/**'
- name: Upload Go test results
if: always()
uses: actions/upload-artifact@v3
with:
name: go-test-results
path: ./pkg_coverage.out