name: CI
on: [push]
env:
CARGO_TERM_COLOR: always
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Clippy
run: cargo clippy --tests --workspace --examples
- name: Build
run: cargo build --verbose --all --examples
- name: Run tests
run: cargo test --verbose --all --examples
- name: Publish (dry run)
run: cargo publish --dry-run
if: github.ref != 'refs/heads/master'
- name: Publish on crates.io
run: |
cargo login ${{ secrets.CRATES_IO_TOKEN }}
cargo publish
if: github.ref == 'refs/heads/master'