language: rust
sudo: "required"
compilers:
  - gcc
  - clang
cache: rustup
rust:
  - stable
matrix:
  allow_failures:
    - rust: nightly
arch:
  packages:
    - meson
    - ninja
    - wayland
    - wayland-protocols
    - mesa
    - libinput
    - pixman
    - libxkbcommon
    - xcb-util-image
    - libcap
    - rustup
    - clang
  script:
    - rustup install stable
    # For rustfmt
    - rustup install nightly
    - rustup default stable
    - rustup run nightly cargo install rustfmt
    - export RUST_BACKTRACE=full
    - git submodule update --init --recursive

    # Build wlroots
    - cd wlroots-sys; cd wlroots; meson build; ninja -C build

    # Build wlroots-sys
    - cd wlroots-sys; cargo build --verbose --features static

    # Build wlroots-rs
    - cargo build --verbose
    - cargo +nightly fmt -- --write-mode=diff
    - cargo build --examples
    - cargo doc

before_script:
  - which rustfmt || cargo install rustfmt
script:
  - "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash"


language: rust
sudo: "required"
compilers:
  - gcc
  - clang
cache: rustup
rust:
  - stable
matrix:
  allow_failures:
    - rust: nightly
arch:
  packages:
    - meson
    - ninja
    - wayland
    - wayland-protocols
    - mesa
    - libinput
    - pixman
    - libxkbcommon
    - xcb-util-image
    - libcap
    - rustup
    - clang
  script:
    - rustup update
    - rustup install stable
    # For rustfmt
    - rustup install nightly
    - rustup default stable
    - rustup run nightly cargo install rustfmt
    - export RUST_BACKTRACE=full
    - git submodule update --init --recursive

    # Build wlroots
    - cd wlroots-sys; cd wlroots; meson build; ninja -C build

    # Build wlroots-sys
    - cd wlroots-sys; cargo build --verbose --features static

    # Build wlroots-rs
    - cargo build --verbose
    - cargo +nightly fmt -- --write-mode=diff
    - cargo build --examples
    - cargo doc

before_script:
  - which rustfmt || cargo install rustfmt
script:
  - "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash"


Update rustup before installing rustfmt
Update rustup before installing rustfmt
