# This is a sample build configuration for Rust.
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: rust:latest

pipelines:
  default:
    - step:
        caches:
          - crates
        script:
          - apt-get update
          - apt-get install -y libsdl2-dev
          - rustup component add rustfmt-preview
          - rustc --verbose --version
          - cargo update -v
          - cargo build -v
          - cargo test -v
          - cargo fmt -- --version
          - cargo fmt --all -- --check
    - step:
        name: Nightly
        image: rustlang/rust:nightly
        caches:
          - crates
        script:
          - apt-get update
          - apt-get install -y libsdl2-dev
          - rustup component add rustfmt-preview --toolchain nightly
          - rustc --verbose --version
          - cargo update -v
          - cargo build -v
          - cargo test -v
          - cargo clippy -v
          - cargo fmt -- --version
          - cargo fmt --all -- --check
definitions:
  caches:
    crates: ~/.cargo


# This is a sample build configuration for Rust.
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: rust:latest

pipelines:
  default:
    - step:
        caches:
          - crates
        script:
          - apt-get update
          - apt-get install -y libsdl2-dev
          - rustup component add rustfmt-preview
          - rustc --verbose --version
          - cargo update -v
          - cargo build -v
          - cargo test -v
          - cargo fmt -- --version
          - cargo fmt --all -- --write-mode=diff
    - step:
        name: Nightly
        image: rustlang/rust:nightly
        caches:
          - crates
        script:
          - apt-get update
          - apt-get install -y libsdl2-dev
          - rustup component add rustfmt-preview --toolchain nightly
          - rustc --verbose --version
          - cargo update -v
          - cargo build -v
          - cargo test -v
          - cargo clippy -v
          - cargo fmt -- --version
          - cargo fmt --all -- --check
definitions:
  caches:
    crates: ~/.cargo


Use stable rustfmt for stable rust.
Use stable rustfmt for stable rust.
