Continuous Integration

Travis CI

To test your package on Travis CI, here is a sample .travis.yml file:

  1. language: rust
  2. rust:
  3. - stable
  4. - beta
  5. - nightly
  6. matrix:
  7. allow_failures:
  8. - rust: nightly

This will test all three release channels, but any breakage in nightlywill not fail your overall build. Please see the Travis CI Rustdocumentation for moreinformation.

GitLab CI

To test your package on GitLab CI, here is a sample .gitlab-ci.yml file:

  1. stages:
  2. - build
  3. rust-latest:
  4. stage: build
  5. image: rust:latest
  6. script:
  7. - cargo build --verbose
  8. - cargo test --verbose
  9. rust-nightly:
  10. stage: build
  11. image: rustlang/rust:nightly
  12. script:
  13. - cargo build --verbose
  14. - cargo test --verbose
  15. allow_failure: true

This will test on the stable channel and nightly channel, but anybreakage in nightly will not fail your overall build. Please see theGitLab CI for moreinformation.

builds.sr.ht

To test your package on sr.ht, here is a sample .build.yml file.Be sure to change <your repo> and <your project> to the repo to clone andthe directory where it was cloned.

  1. image: archlinux
  2. packages:
  3. - rustup
  4. sources:
  5. - <your repo>
  6. tasks:
  7. - setup: |
  8. rustup toolchain install nightly stable
  9. cd <your project>/
  10. rustup run stable cargo fetch
  11. - stable: |
  12. rustup default stable
  13. cd <your project>/
  14. cargo build --verbose
  15. cargo test --verbose
  16. - nightly: |
  17. rustup default nightly
  18. cd <your project>/
  19. cargo build --verbose ||:
  20. cargo test --verbose ||:
  21. - docs: |
  22. cd <your project>/
  23. rustup run stable cargo doc --no-deps
  24. rustup run nightly cargo doc --no-deps ||:

This will test and build documentation on the stable channel and nightlychannel, but any breakage in nightly will not fail your overall build. Pleasesee the builds.sr.ht documentation for moreinformation.