Skip to content

Commit 3e59f03

Browse files
committed
Auto merge of #6565 - SamWhited:add_srht_ci_config, r=alexcrichton
Add builds.sr.ht CI config to book This adds a CI configuration for [builds.sr.ht](https://builds.sr.ht) to the book alongside the existing configurations for Travis and GitLab CI. The config in question is broadly similar to those two, except that I also opted to build the docs as I commonly find markdown oddities this way from the warnings it spits out. I picked Arch Linux as the base image because it's easy to install rustup there (since there's a package for it in the Arch repos), but it could have been Debian or FreeBSD or something else just as easily if you have strong opinions about manually installing rustup. **EDIT:** None of the other build configs had it, so I didn't add publishing tagged commits to crates.io using its secrets mechanism to log cargo in. However, if that's something you think would be beneficial, I can add it.
2 parents edcc37e + 5c8c299 commit 3e59f03

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/doc/src/guide/continuous-integration.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,41 @@ This will test on the stable channel and nightly channel, but any
4848
breakage in nightly will not fail your overall build. Please see the
4949
[GitLab CI](https://docs.gitlab.com/ce/ci/yaml/README.html) for more
5050
information.
51+
52+
### builds.sr.ht
53+
54+
To test your package on sr.ht, here is a sample `.build.yml` file.
55+
Be sure to change `<your repo>` and `<your project>` to the repo to clone and
56+
the directory where it was cloned.
57+
58+
```yaml
59+
image: archlinux
60+
packages:
61+
- rustup
62+
sources:
63+
- <your repo>
64+
tasks:
65+
- setup: |
66+
rustup toolchain install nightly stable
67+
cd <your project>/
68+
rustup run stable cargo fetch
69+
- stable: |
70+
rustup default stable
71+
cd <your project>/
72+
cargo build --verbose
73+
cargo test --verbose
74+
- nightly: |
75+
rustup default nightly
76+
cd <your project>/
77+
cargo build --verbose ||:
78+
cargo test --verbose ||:
79+
- docs: |
80+
cd <your project>/
81+
rustup run stable cargo doc --no-deps
82+
rustup run nightly cargo doc --no-deps ||:
83+
```
84+
85+
This will test and build documentation on the stable channel and nightly
86+
channel, but any breakage in nightly will not fail your overall build. Please
87+
see the [builds.sr.ht documentation](https://man.sr.ht/builds.sr.ht/) for more
88+
information.

0 commit comments

Comments
 (0)