instant-epp/.drone.yml

121 lines
3.2 KiB
YAML

---
kind: pipeline
name: epp-client
platform:
os: linux
arch: amd64
steps:
- name: check
image: ayravat/rust:1.56.1-ci
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo check --all-targets
- name: fmt
image: ayravat/rust:1.56.1-ci
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo fmt --all -- --check
- name: clippy
image: ayravat/rust:1.56.1-ci
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo clippy --workspace --all-targets -- -D warnings
- name: test
image: ayravat/rust:1.56.1-ci
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo test -- --nocapture
- name: crates.io
image: ayravat/rust:1.56.1-docker
volumes:
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
environment:
CARGO_TOKEN:
from_secret: cargo_token
commands:
- export CACHE_DIR=$(echo -n "$DRONE_COMMIT_LINK" | md5sum | cut -f1 -d" ")
- export CARGO_HOME=/tmp/cargo/$CACHE_DIR
- export CARGO_TARGET_DIR=/tmp/cargo-target/$CACHE_DIR
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cd epp-client
- cargo publish --token $CARGO_TOKEN
- cd ..
- cd epp-client-macros
- cargo publish --token $CARGO_TOKEN
when:
branch:
- 0.2
- 0.3
event: push
- name: notify
image: drillster/drone-email
environment:
PLUGIN_HOST:
from_secret: mail_host
PLUGIN_FROM:
from_secret: mail_sender
PLUGIN_FROM_NAME:
from_secret: mail_sender_name
PLUGIN_PORT:
from_secret: mail_port
PLUGIN_USERNAME:
from_secret: mail_user
PLUGIN_PASSWORD:
from_secret: mail_password
PLUGIN_RECIPIENTS:
from_secret: mail_recipients
when:
status:
- failure
volumes:
- name: target
host:
path: /var/drone/cache/epp-client-target
- name: cache
host:
path: /var/drone/cache/epp-client-cache
...