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
4. rust-latest:
5. stage: build
6. image: rust:latest
7. script:
8. - cargo build --verbose
9. - cargo test --verbose
11. rust-nightly:
12. stage: build
13. image: rustlang/rust:nightly
14. script:
15. - cargo build --verbose
16. - cargo test --verbose
17. 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.
