crdt_tree 0.0.16

Tree Conflict-free Replicated Data Type (CRDT)
Documentation
# PR workflow.
#
# Runs full suite of checks, with warnings treated as errors.
# Gathers code coverage stats and publish them on coveralls.io.

name: PR

on: pull_request

env:
  RUST_BACKTRACE: 1
  RUSTFLAGS: "-D warnings"

jobs:
  checks:
    if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
    name: Clippy & fmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt, clippy

      - name: Cargo cache registry, index and build
        uses: actions/cache@v2.1.4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }}
    
      - name: Check formatting
        run: cargo fmt --all -- --check
          
      - name: Clippy checks
        run: cargo clippy --all-targets --all-features -- -Dwarnings

      - name: install rg for licensing verification
        run: cargo install ripgrep

      - uses: maidsafe/verify-licensing-info@main
        name: verify licensing
        with:
          company-name: MaidSafe

  coverage:
    if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
    name: Code coverage check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

      - name: Cargo cache registry, index and build
        uses: actions/cache@v2.1.4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }}

      - name: rust-tarpaulin code coverage check
        uses: actions-rs/tarpaulin@v0.1
        with:
          args: '-v --release --out Lcov'
      - name: Push code coverage results to coveralls.io
        uses: coverallsapp/github-action@master
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          parallel: true
          path-to-lcov: ./lcov.info
      - name: Coveralls Finished
        uses: coverallsapp/github-action@master
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          parallel-finished: true

  cargo-udeps:
    if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
    name: Unused dependency check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          override: true

      - name: Run cargo-udeps
        uses: aig787/cargo-udeps-action@v1
        with:
          version: 'latest'
          args: '--all-targets'

  cargo-deny:
    if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - shell: bash
      run: wget https://raw.githubusercontent.com/maidsafe/QA/master/misc-scripts/deny.toml

    - uses: EmbarkStudios/cargo-deny-action@v1

  tests:
    if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

      - name: Cargo cache registry, index and build
        uses: actions/cache@v2.1.4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }}

      - name: Cargo test
        run: cargo test --release

  dependencies:
    if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
    name: List Duplicate Dependencies
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

      - shell: bash
        run: ./scripts/duplicate_dependency_check

  test-publish:
    if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
    name: Test Publish
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

      - name: Cargo Publish Dry Run
        run: cargo publish --dry-run