From 49d5a8164241ee5a58982d12e2bd3206e5a8f2ee Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 22:22:35 +0100 Subject: [PATCH 01/12] Add circleci config --- .circleci/config.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8931467 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,18 @@ +version: 2.0 + +jobs: + build: + docker: + - image: jimmycuadra/rust + working_directory: ~/md-pdf + steps: + - checkout + - run: which rustfmt || cargo install rustfmt + - run: ./scripts/install-deps.sh + - run: cargo fmt -- --write-mode=diff + - run: cargo build + - run: cargo build --release + - run: cargo test + - run: cargo test --release + - run: cd test-files && cargo run --release -- build + - run: cd test-files && cargo run -- build From 3da3cc52d98b8a3b0f2f80960f58e04ae92f0b70 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 22:36:58 +0100 Subject: [PATCH 02/12] Add cache --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8931467..c6227e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,14 @@ jobs: working_directory: ~/md-pdf steps: - checkout + - restore_cache: + keys: + - cargo - run: which rustfmt || cargo install rustfmt + - save_cache: + key: cargo + paths: + - ~/.cargo - run: ./scripts/install-deps.sh - run: cargo fmt -- --write-mode=diff - run: cargo build From 7bd35cb4033551160b9dc775aaa7cd0a7f1182c3 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 22:43:21 +0100 Subject: [PATCH 03/12] Install wget --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c6227e8..8bf8b0a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,7 @@ jobs: key: cargo paths: - ~/.cargo + - run: sudo apt install -y wget - run: ./scripts/install-deps.sh - run: cargo fmt -- --write-mode=diff - run: cargo build From 783e865abeafdd8c076be9eabba7b7f87a2da1b1 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 22:44:19 +0100 Subject: [PATCH 04/12] No need for sudo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8bf8b0a..3b122cc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: key: cargo paths: - ~/.cargo - - run: sudo apt install -y wget + - run: apt install -y wget - run: ./scripts/install-deps.sh - run: cargo fmt -- --write-mode=diff - run: cargo build From 108c547078bbe1cfe0283e3252f9f9e7e43243de Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 22:45:19 +0100 Subject: [PATCH 05/12] update first --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b122cc..e59a4bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: key: cargo paths: - ~/.cargo - - run: apt install -y wget + - run: apt update && apt install -y wget - run: ./scripts/install-deps.sh - run: cargo fmt -- --write-mode=diff - run: cargo build From c8471db60f8b2d7354b515e5e83150aa83995e15 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 22:47:39 +0100 Subject: [PATCH 06/12] Fix format --- src/build/render.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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); From 8096df58d7bc00bdf18864e0c85150a99c797041 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 22:49:27 +0100 Subject: [PATCH 07/12] Cache after build --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e59a4bf..cdd91b6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,15 +11,15 @@ jobs: keys: - cargo - run: which rustfmt || cargo install rustfmt - - save_cache: - key: cargo - paths: - - ~/.cargo - 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 + paths: + - ~/.cargo - run: cargo test - run: cargo test --release - run: cd test-files && cargo run --release -- build From 535a91713e9fcf4afd86ae87daf55a81a6da885c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 22:51:57 +0100 Subject: [PATCH 08/12] dont try running just yet --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cdd91b6..9610d0e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,5 +22,3 @@ jobs: - ~/.cargo - run: cargo test - run: cargo test --release - - run: cd test-files && cargo run --release -- build - - run: cd test-files && cargo run -- build From 4a133fc8a83b98b0a2f3766e6649954f756fd7c5 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 22:59:54 +0100 Subject: [PATCH 09/12] Update cache key --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9610d0e..11e1d8a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ jobs: - checkout - restore_cache: keys: - - cargo + - cargo-{{ checksum "Cargo.lock" }} - run: which rustfmt || cargo install rustfmt - run: apt update && apt install -y wget - run: ./scripts/install-deps.sh @@ -17,7 +17,7 @@ jobs: - run: cargo build - run: cargo build --release - save_cache: - key: cargo + key: cargo-{{ checksum "Cargo.lock" }} paths: - ~/.cargo - run: cargo test From 76e503c60e3a7a4cfa2344cfc3b0ac7ae84edcd6 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 23:21:06 +0100 Subject: [PATCH 10/12] Also cache target --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 11e1d8a..877bb26 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,5 +20,6 @@ jobs: key: cargo-{{ checksum "Cargo.lock" }} paths: - ~/.cargo + - target/ - run: cargo test - run: cargo test --release From 33695af06440374e2ca7afa7a227c203a75ec729 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 23:25:33 +0100 Subject: [PATCH 11/12] Change badge to circleci --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 715d1507baaaab2f5cb5fb721798da86c7049318 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 15 Aug 2017 23:25:52 +0100 Subject: [PATCH 12/12] remove travis config --- .travis.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .travis.yml 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 -