Skip to content

Commit 8d7b3e5

Browse files
authored
Migrate from Travis to CircleCI (#107)
* Migrate from Travis to CircleCI Closes #92 * Changelog item
1 parent cecc6dc commit 8d7b3e5

File tree

6 files changed

+135
-79
lines changed

6 files changed

+135
-79
lines changed

.circleci/config.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
target_steps: &target_steps
2+
docker:
3+
- image: circleci/rust:1.41.0
4+
steps:
5+
- checkout
6+
- restore_cache:
7+
key: v1-ssd1306-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cargo.toml" }}
8+
- run: rustup self update
9+
- run: sudo apt install -qq python-pip
10+
- run: sudo pip install linkchecker
11+
- run: rustup default ${RUST_VERSION:-stable}
12+
- run: rustup component add rustfmt
13+
- run: |
14+
SYSROOT=$(rustc --print sysroot)
15+
16+
if [[ ! "$SYSROOT" =~ "$TARGET" ]]; then
17+
rustup target add $TARGET
18+
else
19+
echo "Target $TARGET is already installed"
20+
fi
21+
- run: ./build.sh
22+
- save_cache:
23+
key: v1-ssd1306-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cargo.toml" }}
24+
paths:
25+
- ./target
26+
- /home/ubuntu/.cargo
27+
28+
version: 2
29+
jobs:
30+
target-arm-unknown-linux-eabi:
31+
environment:
32+
- TARGET: 'arm-unknown-linux-gnueabi'
33+
- DISABLE_EXAMPLES: 1
34+
<<: *target_steps
35+
36+
target-armv7-unknown-linux-gnueabihf:
37+
environment:
38+
- TARGET: 'armv7-unknown-linux-gnueabihf'
39+
- DISABLE_EXAMPLES: 1
40+
<<: *target_steps
41+
42+
target-x86_64-unknown-linux-gnu:
43+
environment:
44+
- TARGET: 'x86_64-unknown-linux-gnu'
45+
- DISABLE_EXAMPLES: 1
46+
<<: *target_steps
47+
48+
target-x86_64-unknown-linux-musl:
49+
environment:
50+
- TARGET: 'x86_64-unknown-linux-musl'
51+
- DISABLE_EXAMPLES: 1
52+
<<: *target_steps
53+
54+
target-thumbv6m-none-eabi:
55+
environment:
56+
- TARGET: 'thumbv6m-none-eabi'
57+
# Disable example builds as they target thumbv7 and up
58+
- DISABLE_EXAMPLES: 1
59+
<<: *target_steps
60+
61+
target-thumbv7em-none-eabi:
62+
environment:
63+
- TARGET: 'thumbv7em-none-eabi'
64+
<<: *target_steps
65+
66+
target-thumbv7em-none-eabihf:
67+
environment:
68+
- TARGET: 'thumbv7em-none-eabihf'
69+
<<: *target_steps
70+
71+
target-thumbv7m-none-eabi:
72+
environment:
73+
- TARGET: 'thumbv7m-none-eabi'
74+
<<: *target_steps
75+
76+
build_jobs: &build_jobs
77+
jobs:
78+
# Raspberry Pi 1
79+
- target-arm-unknown-linux-eabi
80+
81+
# Raspberry Pi 2, 3, etc
82+
- target-armv7-unknown-linux-gnueabihf
83+
84+
# Linux
85+
- target-x86_64-unknown-linux-gnu
86+
- target-x86_64-unknown-linux-musl
87+
88+
# Bare metal
89+
- target-thumbv6m-none-eabi
90+
- target-thumbv7em-none-eabi
91+
- target-thumbv7em-none-eabihf
92+
- target-thumbv7m-none-eabi
93+
94+
workflows:
95+
version: 2
96+
build_all:
97+
<<: *build_jobs
98+
99+
# Build every day
100+
nightly:
101+
<<: *build_jobs
102+
triggers:
103+
- schedule:
104+
cron: '0 0 * * *'
105+
filters:
106+
branches:
107+
only:
108+
- master

.travis.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
### Changed
1010

11+
- [#107](https://github.com/jamwaffles/ssd1306/pull/107) Migrate from Travis to CircleCI
1112
- [#105](https://github.com/jamwaffles/ssd1306/pull/105) Reduce flash usage by around 400 bytes by replacing some internal `unwrap()`s with `as` coercions.
1213
- [#106](https://github.com/jamwaffles/ssd1306/pull/106) Optimise internals by using iterators to elide bounds checks. Should also speed up `GraphicsMode` (and `embedded-graphics` operations) with a cleaned-up `set_pixel`.
1314

Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ authors = ["James Waples <[email protected]>"]
33
categories = ["embedded", "no-std"]
44
description = "I2C/SPI driver for the SSD1306 OLED display controller"
55
documentation = "https://docs.rs/ssd1306"
6-
exclude = [".travis.yml", ".gitignore"]
76
keywords = ["no-std", "ssd1306", "oled", "embedded", "embedded-hal-driver"]
87
license = "MIT OR Apache-2.0"
98
name = "ssd1306"
@@ -12,9 +11,8 @@ repository = "https://github.com/jamwaffles/ssd1306"
1211
version = "0.3.0-alpha.4"
1312
edition = "2018"
1413

15-
[badges.travis-ci]
16-
branch = "master"
17-
repository = "jamwaffles/ssd1306"
14+
[badges]
15+
circle-ci = { repository = "jamwaffles/ssd1306", branch = "master" }
1816

1917
[package.metadata.docs.rs]
2018
all-features = true

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# SSD1306 driver
22

3-
[![Build Status](https://travis-ci.org/jamwaffles/ssd1306.svg?branch=master)](https://travis-ci.org/jamwaffles/ssd1306)
3+
[![Build Status](https://circleci.com/gh/jamwaffles/ssd1306/tree/master.svg?style=shield)](https://circleci.com/gh/jamwaffles/ssd1306/tree/master)
4+
[![Crates.io](https://img.shields.io/crates/v/ssd1306.svg)](https://crates.io/crates/ssd1306)
5+
[![Docs.rs](https://docs.rs/ssd1306/badge.svg)](https://docs.rs/ssd1306)
46

57
[![CRIUS display showing the Rust logo](readme_banner.jpg?raw=true)](examples/image_i2c.rs)
68

79
I2C and SPI (4 wire) driver for the SSD1306 OLED display.
810

911
See the [announcement blog post](https://wapl.es/electronics/rust/2018/04/30/ssd1306-driver.html) for more information.
1012

11-
Please consider [becoming a sponsor](https://github.com/sponsors/jamwaffles/) so I may continue to maintain these crates in my spare time!
13+
Please consider [becoming a sponsor](https://github.com/sponsors/jamwaffles/) so I may continue to maintain this crate in my spare time!
1214

1315
## [Documentation](https://docs.rs/ssd1306)
1416

build.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
#!/bin/sh
22

3+
# Exit early on error
34
set -e
45

6+
# Print commands as they're run
7+
set -x
8+
9+
if [ -z $TARGET ]; then
10+
echo "TARGET environment variable required but not set"
11+
12+
exit 1
13+
fi
14+
515
cargo fmt --all -- --check
16+
617
cargo build --target $TARGET --all-features --release
718

819
cargo test --lib --target x86_64-unknown-linux-gnu
920
cargo test --doc --target x86_64-unknown-linux-gnu
1021

1122
if [ -z $DISABLE_EXAMPLES ]; then
12-
cargo build --target $TARGET --all-features --examples
23+
cargo build --target $TARGET --all-features --examples
1324
fi
25+
26+
# Remove stale docs - the linkchecker might miss links to old files if they're not removed
27+
cargo clean --doc
28+
cargo clean --doc --target $TARGET
29+
30+
cargo doc --all-features --target $TARGET
31+
32+
linkchecker target/$TARGET/doc/ssd1306/index.html

0 commit comments

Comments
 (0)