diff --git a/ci/after-success.sh b/ci/after-success.sh deleted file mode 100644 index bbe0522bd2..0000000000 --- a/ci/after-success.sh +++ /dev/null @@ -1,77 +0,0 @@ -set -euxo pipefail - -main() { - local langs=( en ru ) - local latest=0.5 - local vers=( 0.4.x ) - - rm -f .cargo/config - cargo doc - - local td=$(mktemp -d) - - # build latest docs - mkdir -p $td/$latest/book/ - cp -r target/doc $td/$latest/api - sed 's|URL|rtic/index.html|g' redirect.html > $td/$latest/api/index.html - - sed 's|URL|0.5|g' redirect.html > $td/index.html - sed 's|URL|book/en|g' redirect.html > $td/$latest/index.html - for lang in ${langs[@]}; do - ( cd book/$lang && mdbook build ) - cp -r book/$lang/book $td/$latest/book/$lang - cp LICENSE-* $td/$latest/book/$lang/ - done - - local root=$(pwd) - # build older docs - for ver in ${vers[@]}; do - local prefix=${ver%.*} - - mkdir -p $td/$prefix/book - local src=$(mktemp -d) - curl -L https://github.com/rtic-rs/cortex-m-rtic/archive/v${ver}.tar.gz | tar xz --strip-components 1 -C $src - - pushd $src - rm -f .cargo/config - cargo doc || cargo doc --features timer-queue - cp -r target/doc $td/$prefix/api - sed 's|URL|rtic/index.html|g' $root/redirect.html > $td/$prefix/api/index.html - for lang in ${langs[@]}; do - ( cd book/$lang && mdbook build ) - cp -r book/$lang/book $td/$prefix/book/$lang - cp LICENSE-* $td/$prefix/book/$lang/ - done - sed 's|URL|book/en|g' $root/redirect.html > $td/$prefix/index.html - popd - - rm -rf $src - done - - # forward CNAME file - cp CNAME $td/ - - mkdir ghp-import - curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz | - tar --strip-components 1 -C ghp-import -xz - - ./ghp-import/ghp_import.py $td - - set +x - git push -fq https://$GH_TOKEN@github.com/rtic-rs/cortex-m-rtic.git gh-pages && echo OK - - rm -rf $td -} - -# fake Travis variables to be able to run this on a local machine -if [ -z ${TRAVIS_BRANCH-} ]; then - TRAVIS_BRANCH=master -fi - -if [ -z ${TRAVIS_PULL_REQUEST-} ]; then - TRAVIS_PULL_REQUEST=false -fi - -if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ]; then - main -fi diff --git a/ci/install.sh b/ci/install.sh deleted file mode 100644 index 624efd87fb..0000000000 --- a/ci/install.sh +++ /dev/null @@ -1,34 +0,0 @@ -set -euxo pipefail - -install_crate() { - local pkg=$1 vers=$2 - - cargo install --list | grep "$pkg v$vers" || ( cd .. && cargo install -f --vers $vers $pkg ) -} - -main() { - # these are not needed for doc builds - if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_PULL_REQUEST != false ]; then - if [ $TARGET = x86_64-unknown-linux-gnu ]; then - install_crate microamp-tools 0.1.0-alpha.3 - rustup target add thumbv6m-none-eabi thumbv7m-none-eabi - fi - - rustup target add $TARGET - mkdir qemu - curl -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 > qemu/qemu-system-arm - chmod +x qemu/qemu-system-arm - - pip install linkchecker --user - fi - - # Download binary mdbook and add to path - curl -L https://github.com/rust-lang/mdBook/releases/download/v0.3.1/mdbook-v0.3.1-x86_64-unknown-linux-gnu.tar.gz > mdbook.tar.gz - tar -xf mdbook.tar.gz - mkdir -p mdbook-bin - mv mdbook mdbook-bin/ - - #install_crate mdbook 0.3.1 -} - -main diff --git a/ci/script.sh b/ci/script.sh deleted file mode 100644 index 6c09909773..0000000000 --- a/ci/script.sh +++ /dev/null @@ -1,256 +0,0 @@ -set -euxo pipefail - -arm_example() { - local COMMAND=$1 - local EXAMPLE=$2 - local BUILD_MODE=$3 - local FEATURES=$4 - local BUILD_NUM=$5 - - if [ $BUILD_MODE = "release" ]; then - local RELEASE_FLAG="--release" - else - local RELEASE_FLAG="" - fi - - if [ -n "$FEATURES" ]; then - local FEATURES_FLAG="--features $FEATURES" - local FEATURES_STR=${FEATURES/,/_}_ - else - local FEATURES_FLAG="" - local FEATURES_STR="" - fi - local CARGO_FLAGS="--example $EXAMPLE --target $TARGET $RELEASE_FLAG $FEATURES_FLAG" - - if [ $COMMAND = "run" ]; then - cargo $COMMAND $CARGO_FLAGS | diff -u ci/expected/$EXAMPLE.run - - else - cargo $COMMAND $CARGO_FLAGS - fi - arm-none-eabi-objcopy -O ihex target/$TARGET/$BUILD_MODE/examples/$EXAMPLE ci/builds/${EXAMPLE}_${FEATURES_STR}${BUILD_MODE}_${BUILD_NUM}.hex -} - - -main() { - local T=$TARGET - - mkdir -p ci/builds - - # Current MSRV cannot handle profiles, remove compilation optimisations - if [[ $TRAVIS_RUST_VERSION == 1.*.* ]]; then - echo "Removing optimisation profiles" - sed -i '/^\[profile.*build-override]$/,/^$/{/^#/!{/^$/!d}}' Cargo.toml - fi - - if [ $T = x86_64-unknown-linux-gnu ]; then - if [[ $TRAVIS_RUST_VERSION == 1.*.* ]]; then - # test on a fixed version (MSRV) to avoid problems with changes in rustc diagnostics - # compile-fail tests - cargo test --test single --target $T - fi - - if [ $TRAVIS_RUST_VERSION = nightly ]; then - # Tests where required MSRV > 1.36 - #local exs=( - #) - #for ex in ${exs[@]}; do - # cargo check --example $ex --target $T - #done - - # multi-core compile-pass tests - pushd heterogeneous - local exs=( - smallest - x-init-2 - x-init - x-schedule - x-spawn - ) - for ex in ${exs[@]}; do - cargo microamp --example $ex --target thumbv7m-none-eabi,thumbv6m-none-eabi --check - done - - popd - - else - if [ $TRAVIS_RUST_VERSION != nightly ]; then - rm -f .cargo/config - cargo doc - ( cd book/en && mdbook build ) - ( cd book/ru && mdbook build ) - - local td=$(mktemp -d) - cp -r target/doc $td/api - mkdir $td/book - cp -r book/en/book $td/book/en - cp -r book/ru/book $td/book/ru - cp LICENSE-* $td/book/en - cp LICENSE-* $td/book/ru - - linkchecker $td/book/en/ - linkchecker $td/book/ru/ - linkchecker $td/api/rtic/ - linkchecker $td/api/cortex_m_rtic_macros/ - fi - fi - - cargo check --target $T - ( cd macros && cargo test --target $T ) - - return - fi - - if [ $TARGET = thumbv6m-none-eabi ]; then - cargo check --target $T --examples - - # Check examples with specific features not compatible with MSRV - if [[ $TRAVIS_RUST_VERSION != 1.*.* ]]; then - cargo check --target $T --examples --features __min_r1_43 - fi - else - cargo check --target $T --examples --features __v7 - - # Check examples with specific features not compatible with MSRV - if [[ $TRAVIS_RUST_VERSION != 1.*.* ]]; then - cargo check --target $T --examples --features __v7,__min_r1_43 - fi - fi - - cargo check -p homogeneous --target $T --examples - - # run-pass tests - case $T in - thumbv6m-none-eabi | thumbv7m-none-eabi) - local exs=( - idle - init - hardware - preempt - binds - - resource - lock - late - only-shared-access - - task - message - capacity - - types - not-send - not-sync - shared-with-init - - generics - cfg - pool - ramfunc - ) - - for ex in ${exs[@]}; do - if [ $ex = pool ]; then - if [ $TARGET = thumbv6m-none-eabi ]; then - continue - fi - - local td=$(mktemp -d) - - cargo run --example $ex --target $TARGET --features __v7 >\ - $td/pool.run - grep 'foo(0x2' $td/pool.run - grep 'bar(0x2' $td/pool.run - arm-none-eabi-objcopy -O ihex target/$TARGET/debug/examples/$ex \ - ci/builds/${ex}___v7_debug_1.hex - - cargo run --example $ex --target $TARGET --features __v7 --release >\ - $td/pool.run - grep 'foo(0x2' $td/pool.run - grep 'bar(0x2' $td/pool.run - arm-none-eabi-objcopy -O ihex target/$TARGET/release/examples/$ex \ - ci/builds/${ex}___v7_release_1.hex - - rm -rf $td - - continue - fi - - if [ $ex = types ]; then - if [ $TARGET = thumbv6m-none-eabi ]; then - continue - fi - - arm_example "run" $ex "debug" "__v7" "1" - arm_example "run" $ex "release" "__v7" "1" - - continue - fi - - arm_example "run" $ex "debug" "" "1" - if [ $ex = types ]; then - arm_example "run" $ex "release" "" "1" - else - arm_example "build" $ex "release" "" "1" - fi - done - - local built=() - cargo clean - for ex in ${exs[@]}; do - if [ $ex = types ] || [ $ex = pool ]; then - if [ $TARGET = thumbv6m-none-eabi ]; then - continue - fi - - arm_example "build" $ex "debug" "__v7" "2" - cmp ci/builds/${ex}___v7_debug_1.hex \ - ci/builds/${ex}___v7_debug_2.hex - arm_example "build" $ex "release" "__v7" "2" - cmp ci/builds/${ex}___v7_release_1.hex \ - ci/builds/${ex}___v7_release_2.hex - else - arm_example "build" $ex "debug" "" "2" - cmp ci/builds/${ex}_debug_1.hex \ - ci/builds/${ex}_debug_2.hex - arm_example "build" $ex "release" "" "2" - cmp ci/builds/${ex}_release_1.hex \ - ci/builds/${ex}_release_2.hex - fi - - built+=( $ex ) - done - - ( cd target/$TARGET/release/examples/ && size ${built[@]} ) - esac -} - -# fake Travis variables to be able to run this on a local machine -if [ -z ${TRAVIS_BRANCH-} ]; then - TRAVIS_BRANCH=auto -fi - -if [ -z ${TRAVIS_PULL_REQUEST-} ]; then - TRAVIS_PULL_REQUEST=false -fi - -if [ -z ${TRAVIS_RUST_VERSION-} ]; then - case $(rustc -V) in - *nightly*) - TRAVIS_RUST_VERSION=nightly - ;; - *beta*) - TRAVIS_RUST_VERSION=beta - ;; - *) - TRAVIS_RUST_VERSION=stable - ;; - esac -fi - -if [ -z ${TARGET-} ]; then - TARGET=$(rustc -Vv | grep host | cut -d ' ' -f2) -fi - -if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_PULL_REQUEST != false ]; then - main -fi