ci: don't install cargo-edit

This commit is contained in:
Jorge Aparicio
2018-04-24 01:42:13 +02:00
parent 2cd4ea31e5
commit 72b23f0e85
4 changed files with 26 additions and 19 deletions

View File

@@ -2,8 +2,6 @@ set -euxo pipefail
main() {
rustup target add $TARGET
cargo install cargo-edit || true
}
main

View File

@@ -17,9 +17,7 @@ EOF
local examples=(
crash
# device
hello
itm
override-exception-handler
panic
)
@@ -28,13 +26,29 @@ EOF
cargo build --target $TARGET --example $ex --release
done
cargo add alloc-cortex-m
# ITM is not available on Cortex-M0
if [ $TARGET != thumbv6m-none-eabi ]; then
local ex=itm
cargo build --target $TARGET --example $ex
cargo build --target $TARGET --example $ex --release
cargo build --target $TARGET --example allocator
cargo build --target $TARGET --example allocator --release
examples+=( $ex )
examples+=( allocator )
fi
# Allocator example needs an extra dependency
cat >>Cargo.toml <<'EOF'
[dependencies.alloc-cortex-m]
version = "0.3.3"
EOF
local ex=allocator
cargo build --target $TARGET --example $ex
cargo build --target $TARGET --example $ex --release
examples+=( $ex )
# Device example needs an extra dependency
if [ $TARGET = thumbv7m-none-eabi ]; then
cat >>Cargo.toml <<'EOF'
[dependencies.stm32f103xx]
@@ -42,10 +56,11 @@ features = ["rt"]
version = "0.9.0"
EOF
cargo build --target $TARGET --example device
cargo build --target $TARGET --example device --release
local ex=device
cargo build --target $TARGET --example $ex
cargo build --target $TARGET --example $ex --release
examples+=( device )
examples+=( $ex )
fi
IFS=,;eval arm-none-eabi-size target/$TARGET/release/examples/"{${examples[*]}}"

View File

@@ -18,7 +18,7 @@
#[macro_use]
extern crate cortex_m;
extern crate cortex_m_rt;
extern crate panic_itm; // panicking behavior
extern crate panic_abort; // panicking behavior
use cortex_m::{asm, Peripherals};
@@ -27,9 +27,6 @@ fn main() {
let mut itm = p.ITM;
iprintln!(&mut itm.stim[0], "Hello, world!");
// Also prints the panic message to the ITM
panic!("Oops");
}
// As we are not using interrupts, we just register a dummy catch all handler

View File

@@ -20,7 +20,7 @@
//! #[macro_use]
//! extern crate cortex_m;
//! extern crate cortex_m_rt;
//! extern crate panic_itm; // panicking behavior
//! extern crate panic_abort; // panicking behavior
//!
//! use cortex_m::{asm, Peripherals};
//!
@@ -29,9 +29,6 @@
//! let mut itm = p.ITM;
//!
//! iprintln!(&mut itm.stim[0], "Hello, world!");
//!
//! // Also prints the panic message to the ITM
//! panic!("Oops");
//! }
//!
//! // As we are not using interrupts, we just register a dummy catch all handler