# An example of using Bitbucket Pipelines for a Rust project
[Bitbucket](https://bitbucket.org/product/features) is the Git solution for professional teams.
[Bitbucket Pipelines](https://confluence.atlassian.com/display/BITBUCKET/Get+started+with+Bitbucket+Pipelines)
allows you to build, test and deploy from Bitbucket.
[Rust](https://www.rust-lang.org/) is a systems programming language that runs blazingly fast,
prevents segfaults, and guarantees thread safety. If you are new to Rust check out
[Setting up a Rust project](docs/setting-up-a-rust-project.md).
The project centers around matching patterns in a noisy signal against a dictionary of known words
from an [alien languge](docs/alien-language.md). To demonstrate the capabilities of Bitbucket
Pipelines the project includes the following aspects:
* a library in the [src/](src/lib.rs) directory that is
[documented](https://doc.rust-lang.org/book/documentation.html) and contains the following types
of tests:
* [unit tests](https://doc.rust-lang.org/book/testing.html#the-tests-module)
* [documentation tests](https://doc.rust-lang.org/book/testing.html#documentation-tests)
* [benchmark tests](https://doc.rust-lang.org/book/benchmark-tests.html)
* [integration tests](https://doc.rust-lang.org/book/testing.html#the-tests-directory) in the
[tests/](tests/alienlanguage.rs) directory
* an example in the [examples/](examples/alienlanguage.rs) directory
Bitbucket Pipelines is used to
* Build the project
* Format the source code
* Run unit tests
* Test the project library's documentation
* Test only the specified integration test target
* Run the benchmarks
* Build the project's documentation
* Package and upload this project to the registry
* Deploy the web service
## Build the project
cargo build --release
## Format the source code
./fmt.sh
## Run unit tests
cargo test --lib --release -v --no-fail-fast -- --nocapture --test
## Test the project library's documentation
cargo test --doc --release -v --no-fail-fast -- --nocapture --test
## Test only the specified integration test target
cargo test --test alienlanguage --release -v --no-fail-fast -- --nocapture --test
## Run the benchmarks
cargo test --lib --release -v --no-fail-fast -- --nocapture --bench
## Build the project's documentation
cargo doc --release --no-deps
target/doc/alienlanguage/index.html
target/doc/webservice/index.html
## Package and upload this project to the registry
## Deploy the web service