Skip to content

Commit

Permalink
add circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2bd committed Apr 28, 2020
1 parent 20f3abf commit 0ad86b3
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
version: 1
jobs:
lint:
docker:
- image: circleci/rust:stretch
steps:
- checkout
- run:
name: Version Information
command: rustc --version; cargo --version; rustup --version
- run:
name: Install Rust Components
command: rustup component add rustfmt clippy
- run:
name: Component Version Information
command: cargo fmt -- --version; cargo clippy -- --version
- run:
name: Setup Env
command: |
echo 'export RUSTFLAGS="-D warnings"' >> $BASH_ENV
- run:
name: Lint (rustfmt)
command: |
cargo fmt -- --check
- run:
name: Lint (clippy)
command: |
cargo clippy
build:
docker:
- image: circleci/rust:stretch
steps:
- checkout
- run:
name: Version Information
command: rustc --version; cargo --version; rustup --version; python3 --version; clang++ --version; javac -version
- run:
name: Setup Env
command: |
echo 'export RUSTFLAGS="-D warnings"' >> $BASH_ENV
- run:
name: Build and Test
# Build all targets to ensure examples are built as well.
command: |
cargo build --all-targets
cargo test
# docs-build and docs-deploy are adapted from
# https://circleci.com/blog/deploying-documentation-to-github-pages-with-continuous-integration/.
docs-build:
docker:
- image: circleci/rust:stretch
steps:
- checkout
- run:
name: Version Information
command: rustc --version; cargo --version; rustup --version
- run:
name: Generate documentation
command: |
cargo doc
- persist_to_workspace:
root: target
paths: doc

workflows:
version: 2
build:
jobs:
- lint
- build
- docs-build

0 comments on commit 0ad86b3

Please sign in to comment.