Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Travis to CircleCI #107

Merged
merged 2 commits into from
Feb 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
target_steps: &target_steps
docker:
- image: circleci/rust:1.41.0
steps:
- checkout
- restore_cache:
key: v1-ssd1306-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cargo.toml" }}
- run: rustup self update
- run: sudo apt install -qq python-pip
- run: sudo pip install linkchecker
- run: rustup default ${RUST_VERSION:-stable}
- run: rustup component add rustfmt
- run: |
SYSROOT=$(rustc --print sysroot)

if [[ ! "$SYSROOT" =~ "$TARGET" ]]; then
rustup target add $TARGET
else
echo "Target $TARGET is already installed"
fi
- run: ./build.sh
- save_cache:
key: v1-ssd1306-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cargo.toml" }}
paths:
- ./target
- /home/ubuntu/.cargo

version: 2
jobs:
target-arm-unknown-linux-eabi:
environment:
- TARGET: 'arm-unknown-linux-gnueabi'
- DISABLE_EXAMPLES: 1
<<: *target_steps

target-armv7-unknown-linux-gnueabihf:
environment:
- TARGET: 'armv7-unknown-linux-gnueabihf'
- DISABLE_EXAMPLES: 1
<<: *target_steps

target-x86_64-unknown-linux-gnu:
environment:
- TARGET: 'x86_64-unknown-linux-gnu'
- DISABLE_EXAMPLES: 1
<<: *target_steps

target-x86_64-unknown-linux-musl:
environment:
- TARGET: 'x86_64-unknown-linux-musl'
- DISABLE_EXAMPLES: 1
<<: *target_steps

target-thumbv6m-none-eabi:
environment:
- TARGET: 'thumbv6m-none-eabi'
# Disable example builds as they target thumbv7 and up
- DISABLE_EXAMPLES: 1
<<: *target_steps

target-thumbv7em-none-eabi:
environment:
- TARGET: 'thumbv7em-none-eabi'
<<: *target_steps

target-thumbv7em-none-eabihf:
environment:
- TARGET: 'thumbv7em-none-eabihf'
<<: *target_steps

target-thumbv7m-none-eabi:
environment:
- TARGET: 'thumbv7m-none-eabi'
<<: *target_steps

build_jobs: &build_jobs
jobs:
# Raspberry Pi 1
- target-arm-unknown-linux-eabi

# Raspberry Pi 2, 3, etc
- target-armv7-unknown-linux-gnueabihf

# Linux
- target-x86_64-unknown-linux-gnu
- target-x86_64-unknown-linux-musl

# Bare metal
- target-thumbv6m-none-eabi
- target-thumbv7em-none-eabi
- target-thumbv7em-none-eabihf
- target-thumbv7m-none-eabi

workflows:
version: 2
build_all:
<<: *build_jobs

# Build every day
nightly:
<<: *build_jobs
triggers:
- schedule:
cron: '0 0 * * *'
filters:
branches:
only:
- master
72 changes: 0 additions & 72 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Changed

- [#107](https://github.com/jamwaffles/ssd1306/pull/107) Migrate from Travis to CircleCI
- [#105](https://github.com/jamwaffles/ssd1306/pull/105) Reduce flash usage by around 400 bytes by replacing some internal `unwrap()`s with `as` coercions.
- [#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`.

Expand Down
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ authors = ["James Waples <[email protected]>"]
categories = ["embedded", "no-std"]
description = "I2C/SPI driver for the SSD1306 OLED display controller"
documentation = "https://docs.rs/ssd1306"
exclude = [".travis.yml", ".gitignore"]
keywords = ["no-std", "ssd1306", "oled", "embedded", "embedded-hal-driver"]
license = "MIT OR Apache-2.0"
name = "ssd1306"
Expand All @@ -12,9 +11,8 @@ repository = "https://github.com/jamwaffles/ssd1306"
version = "0.3.0-alpha.4"
edition = "2018"

[badges.travis-ci]
branch = "master"
repository = "jamwaffles/ssd1306"
[badges]
circle-ci = { repository = "jamwaffles/ssd1306", branch = "master" }

[package.metadata.docs.rs]
all-features = true
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# SSD1306 driver

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

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

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

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

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

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

Expand Down
21 changes: 20 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
#!/bin/sh

# Exit early on error
set -e

# Print commands as they're run
set -x

if [ -z $TARGET ]; then
echo "TARGET environment variable required but not set"

exit 1
fi

cargo fmt --all -- --check

cargo build --target $TARGET --all-features --release

cargo test --lib --target x86_64-unknown-linux-gnu
cargo test --doc --target x86_64-unknown-linux-gnu

if [ -z $DISABLE_EXAMPLES ]; then
cargo build --target $TARGET --all-features --examples
cargo build --target $TARGET --all-features --examples
fi

# Remove stale docs - the linkchecker might miss links to old files if they're not removed
cargo clean --doc
cargo clean --doc --target $TARGET

cargo doc --all-features --target $TARGET

linkchecker target/$TARGET/doc/ssd1306/index.html