version: 2
jobs:
  build:
    docker:
      - image: mozmedia/cubeb-rust:fc27
    environment:
      TZ: "/usr/share/zoneinfo/Australia/Brisbane"
    steps:
      - checkout
      - restore_cache:
          key: project-cache
      - run:
          name: Check formatting
          command: |
            rustfmt --version
            cargo fmt -- --write-mode=diff
      - run:
          name: Nightly Build
          command: |
            rustup run nightly rustc --version --verbose
            rustup run nightly cargo --version --verbose
            rustup run nightly cargo build --all
      - run:
          name: Nightly Build x86
          command: |
            rustup run nightly-i686-unknown-linux-gnu rustc --version --verbose
            rustup run nightly-i686-unknown-linux-gnu cargo build --all
      - run:
          name: Stable Build
          command: |
            rustup run stable rustc --version --verbose
            rustup run stable cargo --version --verbose
            rustup run stable cargo build --all
      - run:
          name: Stable Build x86
          command: |
            rustup run stable-i686-unknown-linux-gnu rustc --version --verbose
            rustup run stable-i686-unknown-linux-gnu cargo build --all
      - run:
          name: Test
          command: rustup run stable cargo test --all
      - run:
          name: Test x86
          command: rustup run stable-i686-unknown-linux-gnu cargo test --all
      - save_cache:
          key: project-cache
          paths:
            - "~/.cargo"
            - "./target"

version: 2
jobs:
  build:
    docker:
      - image: mozmedia/cubeb-rust:fc27
    environment:
      TZ: "/usr/share/zoneinfo/Australia/Brisbane"
    steps:
      - checkout
      - restore_cache:
          key: project-cache
      - run:
          name: Check formatting
          command: |
            cargo +nightly fmt --version
            cargo +nightly fmt -- --write-mode=diff
      - run:
          name: Nightly Build
          command: |
            rustup run nightly rustc --version --verbose
            rustup run nightly cargo --version --verbose
            rustup run nightly cargo build --all
      - run:
          name: Nightly Build x86
          command: |
            rustup run nightly-i686-unknown-linux-gnu rustc --version --verbose
            rustup run nightly-i686-unknown-linux-gnu cargo build --all
      - run:
          name: Stable Build
          command: |
            rustup run stable rustc --version --verbose
            rustup run stable cargo --version --verbose
            rustup run stable cargo build --all
      - run:
          name: Stable Build x86
          command: |
            rustup run stable-i686-unknown-linux-gnu rustc --version --verbose
            rustup run stable-i686-unknown-linux-gnu cargo build --all
      - run:
          name: Test
          command: rustup run stable cargo test --all
      - run:
          name: Test x86
          command: rustup run stable-i686-unknown-linux-gnu cargo test --all
      - save_cache:
          key: project-cache
          paths:
            - "~/.cargo"
            - "./target"

Use nightly version of cargo-fmt and rustfmt
CircleCI: Use nightly version of cargo-fmt and rustfmt
