From e92b519d300765f2dc43915a23ad7541abac3368 Mon Sep 17 00:00:00 2001 From: Mathieu Poumeyrol Date: Wed, 26 Jun 2024 14:03:18 +0200 Subject: [PATCH] split full --- .github/workflows/full.yml | 75 ++++++++++++++++++++++++++++++- .travis/regular-tests.sh | 77 ++------------------------------ .travis/test-harness.sh | 31 +++++++++++++ .travis/test-published-crates.sh | 39 ++++++++++++++++ .travis/test-rt.sh | 35 +++++++++++++++ 5 files changed, 182 insertions(+), 75 deletions(-) create mode 100755 .travis/test-harness.sh create mode 100755 .travis/test-published-crates.sh create mode 100755 .travis/test-rt.sh diff --git a/.github/workflows/full.yml b/.github/workflows/full.yml index 1af30ffc3c..51f821dd06 100644 --- a/.github/workflows/full.yml +++ b/.github/workflows/full.yml @@ -10,7 +10,7 @@ env: CARGO_INCREMENTAL: false jobs: - regular-tests: + test-published-crates: runs-on: ubuntu-latest strategy: fail-fast: false @@ -43,7 +43,78 @@ jobs: key: ${{ runner.os }}-full-regular-${{steps.date.outputs.date}}-e - name: Full test - run: .travis/regular-tests.sh + run: .travis/test-published-crates.sh + + runtime-bass-tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v3 + + - name: Configure AWS Credentials + # if: github.repository == 'sonos/tract' + continue-on-error: true + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::567805100031:role/github-runner-tract-ci + aws-region: us-east-2 + + - name: Get current date + id: date + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + with: + path: | + ~/.rustup + ~/.cargo/registry + ~/.cargo/git + target + .cached + key: ${{ runner.os }}-full-regular-${{steps.date.outputs.date}}-e + + - name: Full test + run: .travis/test-rt.sh + + + old-harness: + runs-on: ubuntu-latest + strategy: + fail-fast: false + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v3 + + - name: Configure AWS Credentials + # if: github.repository == 'sonos/tract' + continue-on-error: true + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::567805100031:role/github-runner-tract-ci + aws-region: us-east-2 + + - name: Get current date + id: date + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + with: + path: | + ~/.rustup + ~/.cargo/registry + ~/.cargo/git + target + .cached + key: ${{ runner.os }}-full-regular-${{steps.date.outputs.date}}-e + + - name: Full test + run: .travis/test-harness.sh check-all-targets: runs-on: ubuntu-latest diff --git a/.travis/regular-tests.sh b/.travis/regular-tests.sh index a670d1b85b..9f35582f3f 100755 --- a/.travis/regular-tests.sh +++ b/.travis/regular-tests.sh @@ -1,78 +1,9 @@ #!/bin/sh -WHITE='\033[1;37m' -NC='\033[0m' # No Color - -if [ -e /proc/cpuinfo ] -then - grep "^flags" /proc/cpuinfo | head -1 | \ - grep --color=always '\(s\?sse[0-9_]*\|fma\|f16c\|avx[^ ]*\)' -fi - set -x -. $(dirname $0)/ci-system-setup.sh - -set -e - -if [ `arch` = "x86_64" -a "$RUST_VERSION" = "stable" ] -then - ALL_FEATURES=--all-features -fi - -set +x - -for c in data linalg core nnef hir onnx pulse onnx-opl pulse-opl rs proxy -do - echo - echo "$WHITE ### $c ### $NC" - echo - cargo -q test $CARGO_EXTRA -q -p tract-$c -done - -for c in test-rt/test* -do - if [ "$c" != "test-rt/test-tflite" ] - then - echo - echo "$WHITE ### $c ### $NC" - echo - (cd $c; cargo test -q $CARGO_EXTRA) - fi -done - -# doc test are not finding libtensorflow.so -if ! cargo -q test $CARGO_EXTRA -q -p tract-tensorflow --lib $ALL_FEATURES -then - # this crate triggers an incremental bug on nightly. - cargo clean -p tract-tensorflow - cargo -q test $CARGO_EXTRA -q -p tract-tensorflow --lib $ALL_FEATURES -fi - -if [ -n "$SHORT" ] -then - exit 0 -fi - -# if [ -n "$GITHUB_ACTIONS" ] -# then -# CLEANUP="rm -rf $CACHEDIR/*" -# else - CLEANUP=true -# fi +cd $(dirname $0) -$CLEANUP -cargo -q test $CARGO_EXTRA -q -p tract-rs -$CLEANUP -cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p core-proptest-pulse $ALL_FEATURES -$CLEANUP -cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p lstm-proptest-onnx-vs-tf $ALL_FEATURES -$CLEANUP -cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p nnef-inceptionv3 $ALL_FEATURES -$CLEANUP -cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p tf-inceptionv3 $ALL_FEATURES -$CLEANUP -cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p tf-mobilenet-v2 $ALL_FEATURES -$CLEANUP -cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p tf-moz-deepspeech $ALL_FEATURES -CACHEDIR=$OLD_CACHEDIR +./test-published-crates.sh +./test-rt.sh +./test-harness.sh diff --git a/.travis/test-harness.sh b/.travis/test-harness.sh new file mode 100755 index 0000000000..bfffb0ce16 --- /dev/null +++ b/.travis/test-harness.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +WHITE='\033[1;37m' +NC='\033[0m' # No Color + +if [ -e /proc/cpuinfo ] +then + grep "^flags" /proc/cpuinfo | head -1 | \ + grep --color=always '\(s\?sse[0-9_]*\|fma\|f16c\|avx[^ ]*\)' +fi + +set -x + +. $(dirname $0)/ci-system-setup.sh + +set -e + +if [ `arch` = "x86_64" -a "$RUST_VERSION" = "stable" ] +then + ALL_FEATURES=--all-features +fi + +set +x + +cargo -q test $CARGO_EXTRA -q -p tract-rs +cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p core-proptest-pulse $ALL_FEATURES +cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p lstm-proptest-onnx-vs-tf $ALL_FEATURES +cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p nnef-inceptionv3 $ALL_FEATURES +cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p tf-inceptionv3 $ALL_FEATURES +cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p tf-mobilenet-v2 $ALL_FEATURES +cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p tf-moz-deepspeech $ALL_FEATURES diff --git a/.travis/test-published-crates.sh b/.travis/test-published-crates.sh new file mode 100755 index 0000000000..fc0d04b09a --- /dev/null +++ b/.travis/test-published-crates.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +WHITE='\033[1;37m' +NC='\033[0m' # No Color + +if [ -e /proc/cpuinfo ] +then + grep "^flags" /proc/cpuinfo | head -1 | \ + grep --color=always '\(s\?sse[0-9_]*\|fma\|f16c\|avx[^ ]*\)' +fi + +set -x + +. $(dirname $0)/ci-system-setup.sh + +set -e + +if [ `arch` = "x86_64" -a "$RUST_VERSION" = "stable" ] +then + ALL_FEATURES=--all-features +fi + +set +x + +for c in data linalg core nnef hir onnx pulse onnx-opl pulse-opl rs proxy +do + echo + echo "$WHITE ### $c ### $NC" + echo + cargo -q test $CARGO_EXTRA -q -p tract-$c +done + +# doc test are not finding libtensorflow.so +if ! cargo -q test $CARGO_EXTRA -q -p tract-tensorflow --lib $ALL_FEATURES +then + # this crate triggers an incremental bug on nightly. + cargo clean -p tract-tensorflow + cargo -q test $CARGO_EXTRA -q -p tract-tensorflow --lib $ALL_FEATURES +fi diff --git a/.travis/test-rt.sh b/.travis/test-rt.sh new file mode 100755 index 0000000000..5ebac1ff3b --- /dev/null +++ b/.travis/test-rt.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +WHITE='\033[1;37m' +NC='\033[0m' # No Color + +if [ -e /proc/cpuinfo ] +then + grep "^flags" /proc/cpuinfo | head -1 | \ + grep --color=always '\(s\?sse[0-9_]*\|fma\|f16c\|avx[^ ]*\)' +fi + +set -x + +. $(dirname $0)/ci-system-setup.sh + +set -e + +if [ `arch` = "x86_64" -a "$RUST_VERSION" = "stable" ] +then + ALL_FEATURES=--all-features +fi + +set +x + +for c in test-rt/test* +do + if [ "$c" != "test-rt/test-tflite" ] + then + echo + echo "$WHITE ### $c ### $NC" + echo + (cd $c; cargo test -q $CARGO_EXTRA) + fi +done +