Skip to content

Commit

Permalink
split full
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Jun 26, 2024
1 parent 56a12f7 commit e92b519
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 75 deletions.
75 changes: 73 additions & 2 deletions .github/workflows/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
CARGO_INCREMENTAL: false

jobs:
regular-tests:
test-published-crates:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -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
Expand Down
77 changes: 4 additions & 73 deletions .travis/regular-tests.sh
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions .travis/test-harness.sh
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions .travis/test-published-crates.sh
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions .travis/test-rt.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e92b519

Please sign in to comment.