diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..877bb26 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,25 @@ +version: 2.0 + +jobs: + build: + docker: + - image: jimmycuadra/rust + working_directory: ~/md-pdf + steps: + - checkout + - restore_cache: + keys: + - cargo-{{ checksum "Cargo.lock" }} + - run: which rustfmt || cargo install rustfmt + - run: apt update && apt install -y wget + - run: ./scripts/install-deps.sh + - run: cargo fmt -- --write-mode=diff + - run: cargo build + - run: cargo build --release + - save_cache: + key: cargo-{{ checksum "Cargo.lock" }} + paths: + - ~/.cargo + - target/ + - run: cargo test + - run: cargo test --release diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2699349..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: rust -rust: - - stable -cache: cargo - -before_script: - - export PATH="$PATH:$HOME/.cargo/bin" - - which rustfmt || cargo install rustfmt - -script: - - ./scripts/install-deps.sh - - cargo fmt -- --write-mode=diff - - cargo build - - cargo build --release - - cargo test - - cargo test --release - - cd test-files && cargo run --release -- build && cd - - - cd test-files && cargo run -- build && cd - diff --git a/README.md b/README.md index 0a3d06b..8535e4e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # md-pdf -[![Travis](https://img.shields.io/travis/hoily/md-pdf.svg?style=flat-square)](https://travis-ci.org/hoily/md-pdf) +[![CircleCI](https://img.shields.io/circleci/project/github/hoily/md-pdf.svg?style=flat-square)](https://circleci.com/gh/hoily/md-pdf) Convert markdown files into PDF Documents. diff --git a/src/build/render.rs b/src/build/render.rs index e62854b..49f6f00 100644 --- a/src/build/render.rs +++ b/src/build/render.rs @@ -7,9 +7,7 @@ fn stub(config: Config, input: String) -> Result { pub fn render(config: Config, input: String) -> Result { let mut rendered_input = input; - for renderer in vec![ - stub - ] { + for renderer in vec![stub] { rendered_input = try!(renderer(config.clone(), rendered_input)); } return Ok(rendered_input);