diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..3b1fd05 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,68 @@ +image: "rust:slim" + +stages: + - check + - build + - test + - release + +variables: + RUST_VERSION: stable + +# Cargo artifacts caching per Rust version and pipeline +cache: + key: "$RUST_VERSION" + paths: + - /usr/local/rustup/ + - /usr/local/cargo/ + - target/ + +# Install compiler and OpenSSL dependencies +before_script: + - apt-get update + - apt-get install -y --no-install-recommends build-essential pkg-config libssl-dev + - | + rustup install $RUST_VERSION + rustup default $RUST_VERSION + - | + rustc --version + cargo --version + +# Variable defaults +variables: + RUST_VERSION: stable + +# Check on stable, beta and nightly +.check-base: &check-base + stage: check + script: + - cargo check --verbose +rust-stable: + <<: *check-base +rust-beta: + <<: *check-base + variables: + RUST_VERSION: beta + cache: {} +rust-nightly: + <<: *check-base + variables: + RUST_VERSION: nightly + cache: {} + +# Run the unit tests through Cargo +cargo-test: + stage: test + dependencies: [] + script: + - cargo test --verbose + +# Cargo crate release +crate: + stage: release + only: + - "/^v([0-9]+\\.)*[0-9]+.*$/" + script: + - echo "Creating release crate on crates.io..." + - echo $CARGO_TOKEN | cargo login + - cargo publish --verbose diff --git a/README.md b/README.md index d7f9ea4..5801780 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ This repository is still being worked on, and this documentation is not finished yet. Here is a demo of the API implementation as used in [ffsend][ffsend]: -[![ffsend-api implementation demo from ffsend][ffsend-usage-demo-svg]][ffsend-usage-demo-asciinema] +[![ffsend-api implementation demo from ffsend][ffsend-usage-demo-svg]][ffsend-usage-demo-asciinema] _Implementation demo from [ffsend][ffsend] not visible here? View it on [asciinema][ffsend-usage-demo-asciinema]._