saltyrtc-client 0.5.0

Asynchronous SaltyRTC client implementation for Rust 1.26+.
Documentation
version: 2
jobs:
  build:
    docker:
      - image: saltyrtc/circleci-image-rs:master
    steps:
      - checkout

      # Load cargo target from cache if possible.
      # Multiple caches are used to increase the chance of a cache hit.
      - restore_cache:
          keys:
            - v1-cargo-cache-{{ arch }}-{{ .Branch }}
            - v1-cargo-cache-{{ arch }}

      # Diagnostics
      - run:
          name: Show versions
          command: rustc --version && cargo --version

      # Certificates
      - run:
          name: Generate certificates
          command: /saltyrtc/certs/generate-cert.sh
      - run:
          name: Copy certificate
          command: cp /saltyrtc/certs/saltyrtc.der .

      # Start processes
      - run:
          name: Start SaltyRTC server
          command: nohup saltyrtc-server-launcher > server.pid

      # Build and test main crate
      - run:
          name: Build (Rust)
          command: cargo build
      - run:
          name: Test (Rust)
          command: cargo test
      - run:
          name: Build with flags (Rust)
          command: cargo build
      - run:
          name: Audit (Rust)
          command: cargo audit

      # Build and test FFI crate
      - run:
          name: Build (Rust FFI)
          command: cd ffi && cargo build
      - run:
          name: Test (Rust FFI)
          command: cd ffi && cargo test
      - run:
          name: Audit (Rust FFI)
          command: cd ffi && cargo audit

      # Show server log
      - run:
          name: Print server log
          command: cat /saltyrtc/serverlog.txt

      # Save cache
      - save_cache:
          key: v1-cargo-cache-{{ arch }}-{{ .Branch }}
          paths:
            - target
            - ffi/target
            - /usr/local/cargo
      - save_cache:
          key: v1-cargo-cache-{{ arch }}
          paths:
            - target
            - ffi/target
            - /usr/local/cargo