Skip to content

Commit daeb0bb

Browse files
committed
add CI
1 parent d636240 commit daeb0bb

File tree

5 files changed

+129
-0
lines changed

5 files changed

+129
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.#*
33
/target
44
Cargo.lock
5+
bin/*.after
6+
bin/*.before

.travis.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
language: rust
2+
3+
matrix:
4+
include:
5+
- env: TARGET=x86_64-unknown-linux-gnu
6+
rust: 1.31
7+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
8+
9+
- env: TARGET=armv7r-none-eabi
10+
rust: 1.31
11+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
12+
13+
- env: TARGET=armv7r-none-eabihf
14+
rust: 1.31
15+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
16+
17+
- env: TARGET=armebv7r-none-eabi
18+
rust: 1.31
19+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
20+
21+
- env: TARGET=armebv7r-none-eabihf
22+
rust: 1.31
23+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
24+
25+
- env: TARGET=x86_64-unknown-linux-gnu
26+
rust: nightly
27+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
28+
29+
- env: TARGET=armv7r-none-eabi
30+
rust: nightly
31+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
32+
33+
- env: TARGET=armv7r-none-eabihf
34+
rust: nightly
35+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
36+
37+
- env: TARGET=armebv7r-none-eabi
38+
rust: nightly
39+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
40+
41+
- env: TARGET=armebv7r-none-eabihf
42+
rust: nightly
43+
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
44+
45+
before_install: set -e
46+
47+
install:
48+
- bash ci/install.sh
49+
- export PATH="$PATH:$PWD/gcc/bin"
50+
51+
script:
52+
- bash ci/script.sh
53+
54+
after_script: set +e
55+
56+
cache: cargo
57+
58+
before_cache:
59+
- chmod -R a+r $HOME/.cargo;
60+
61+
branches:
62+
only:
63+
- master
64+
- staging
65+
- trying
66+
67+
notifications:
68+
email:
69+
on_success: never

check-blobs.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Checks that the blobs are up to date with the committed assembly files
4+
5+
set -euxo pipefail
6+
7+
for lib in $(ls bin/*.a); do
8+
filename=$(basename $lib)
9+
arm-none-eabi-objdump -Cd $lib > bin/${filename%.a}.before
10+
done
11+
12+
./assemble.sh
13+
14+
for lib in $(ls bin/*.a); do
15+
filename=$(basename $lib)
16+
arm-none-eabi-objdump -Cd $lib > bin/${filename%.a}.after
17+
done
18+
19+
for cksum in $(ls bin/*.after); do
20+
diff -u $cksum ${cksum%.after}.before
21+
done

ci/install.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set -euxo pipefail
2+
3+
main() {
4+
case $TARGET in
5+
arm*v7r-none-eabi*)
6+
rustup target add $TARGET
7+
;;
8+
*)
9+
mkdir gcc
10+
curl -L https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2?revision=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2018-q2-update | tar --strip-components=1 -C gcc -xj
11+
;;
12+
esac
13+
}
14+
15+
main

ci/script.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
set -euxo pipefail
2+
3+
main() {
4+
cargo check --target $TARGET
5+
6+
if [ $TRAVIS_RUST_VERSION = nightly ]; then
7+
cargo check --target $TARGET --features inline-asm
8+
fi
9+
10+
case $TARGET in
11+
arm*v7r-none-eabi*)
12+
;;
13+
14+
*)
15+
cargo test --target $TARGET
16+
17+
./check-blobs.sh
18+
;;
19+
esac
20+
}
21+
22+
main

0 commit comments

Comments
 (0)