stages:
  - build_and_test

build:nightly:
  stage: build_and_test
  script:
    - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
    - source $HOME/.cargo/env
    - cargo build --features integration-test,nightly --all-targets
    - mkdir /sys/fs/cgroup/{cpuacct,memory,pids}/ia-sandbox
    - cargo test --features nightly -v

build:stable:
  stage: build_and_test
  script:
    - curl https://sh.rustup.rs -sSf | sh -s -- -y
    - source $HOME/.cargo/env
    - rustup component add rustfmt-preview clippy-preview
    - cargo build --features integration-test --all-targets
    - mkdir /sys/fs/cgroup/{cpuacct,memory,pids}/ia-sandbox
    - cargo test -v
    - cargo fmt -- --check
    - cargo clippy --all-targets

build:beta:
  stage: build_and_test
  script:
    - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain beta
    - source $HOME/.cargo/env
    - cargo build --features integration-test --all-targets
    - mkdir /sys/fs/cgroup/{cpuacct,memory,pids}/ia-sandbox
    - cargo test -v

build:nightly:minimal:
  stage: build_and_test
  script:
    - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
    - source $HOME/.cargo/env
    - cargo build --features integration-test,nightly --all-targets -Z minimal-versions
    - mkdir /sys/fs/cgroup/{cpuacct,memory,pids}/ia-sandbox
    - cargo test --features nightly -v

stages:
  - build_and_test

build:nightly:
  stage: build_and_test
  script:
    - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
    - source $HOME/.cargo/env
    - cargo build --features integration-test,nightly --all-targets
    - mkdir /sys/fs/cgroup/{cpuacct,memory,pids}/ia-sandbox
    - cargo test --features nightly -v

build:stable:
  stage: build_and_test
  script:
    - curl https://sh.rustup.rs -sSf | sh -s -- -y
    - source $HOME/.cargo/env
    - rustup component add rustfmt-preview clippy-preview
    - cargo build --features integration-test --all-targets
    - mkdir /sys/fs/cgroup/{cpuacct,memory,pids}/ia-sandbox
    - cargo test -v
    - cargo fmt -- --check
    - cargo clippy --all-targets

build:beta:
  stage: build_and_test
  script:
    - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain beta
    - source $HOME/.cargo/env
    - cargo build --features integration-test --all-targets
    - mkdir /sys/fs/cgroup/{cpuacct,memory,pids}/ia-sandbox
    - cargo test -v

Remove pipeline checking minimal versions as it does not link.
Remove pipeline checking minimal versions as it does not link.
