22
33## Testing infrastructure
44
5- <!-- date-check: oct 2022 -->
5+ <!-- date-check: may 2024 -->
66When a Pull Request is opened on GitHub, [ GitHub Actions] will automatically
77launch a build that will run all tests on some configurations
8- (x86_64-gnu-llvm-13 linux, x86_64-gnu-tools linux, and mingw-check linux).
8+ (x86_64-gnu-llvm-X linux, x86_64-gnu-tools linux, mingw-check linux and mingw-check-tidy linux).
99In essence, each runs ` ./x test ` with various different options.
1010
1111The integration bot [ bors] is used for coordinating merges to the master branch.
1212When a PR is approved, it goes into a [ queue] where merges are tested one at a
1313time on a wide set of platforms using GitHub Actions. Due to the limit on the
14- number of parallel jobs, we run CI under the [ rust-lang-ci] organization except
15- for PRs .
14+ number of parallel jobs, we run the main CI jobs under the [ rust-lang-ci] organization
15+ (in contrast to PR CI jobs, which run under ` rust-lang ` directly) .
1616Most platforms only run the build steps, some run a restricted set of tests,
1717only a subset run the full suite of tests (see Rust's [ platform tiers] ).
1818
19- If everything passes, then all of the distribution artifacts that were
19+ If everything passes, then all the distribution artifacts that were
2020generated during the CI run are published.
2121
2222[ GitHub Actions ] : https://github.com/rust-lang/rust/actions
2323[ rust-lang-ci ] : https://github.com/rust-lang-ci/rust/actions
24- [ bors ] : https://github.com/servo /homu
24+ [ bors ] : https://github.com/rust-lang /homu
2525[ queue ] : https://bors.rust-lang.org/queue/rust
2626[ platform tiers ] : https://forge.rust-lang.org/release/platform-support.html#rust-platform-support
2727
@@ -40,35 +40,31 @@ For example, if a Windows build fails, but you don't have access to a Windows
4040machine, you can try running the Windows job that failed on CI within your PR
4141after pushing a possible fix.
4242
43- To do this, you'll need to edit [ ` src/ci/github-actions/ci.yml ` ] .
44- The ` jobs ` section defines the jobs that will run.
45- The ` jobs.pr ` section defines everything that will run in a push to a PR.
46- The ` jobs.auto ` section defines the full set of tests that are run after a PR is approved.
47- You can copy one of the definitions from the ` auto ` section up to the ` pr ` section.
43+ To do this, you'll need to edit [ ` src/ci/github-actions/jobs.yml ` ] . It contains three
44+ sections that affect which CI jobs will be executed:
45+ - The ` pr ` section defines everything that will run after a push to a PR.
46+ - The ` try ` section defines job(s) that are run when you ask for a try build using ` @bors try ` .
47+ - The ` auto ` section defines the full set of tests that are run after a PR is approved and before
48+ it is merged into the main branch.
4849
49- For example, the ` x86_64-msvc-1 ` and ` x86_64-msvc-2 ` jobs are responsible for
50- running the 64-bit MSVC tests.
51- You can copy those up to the ` jobs.pr.strategy.matrix.include ` section with
52- the other jobs .
50+ You can copy one of the definitions from the ` auto ` section to the ` pr ` or ` try ` sections.
51+ For example, the ` x86_64-msvc ` job is responsible for running the 64-bit MSVC tests.
52+ You can copy it to the ` pr ` section to cause it to be executed after a commit is pushed to your
53+ PR .
5354
54- The comment at the top of ` ci.yml ` will tell you to run this command:
55+ Then, you can commit the file and push to GitHub. GitHub Actions should launch the tests.
5556
56- ``` sh
57- ./x run src/tools/expand-yaml-anchors
58- ```
57+ After you have finished your tests, don't forget to remove any changes you have made to ` jobs.yml ` .
5958
60- This will generate the true [ ` .github/workflows/ci.yml ` ] which is what GitHub
61- Actions uses.
59+ If you need to make more complex modifications to CI, you will need to modify
60+ [ ` .github/workflows/ci.yml ` ] and possibly also
61+ [ ` src/ci/github-actions/calculate-job-matrix.py ` ] .
6262
63- Then, you can commit those two files and push to GitHub.
64- GitHub Actions should launch the tests.
65-
66- After you have finished, don't forget to remove any changes you have made to ` ci.yml ` .
67-
68- Although you are welcome to use CI, just be conscientious that this is a shared
63+ Although you are welcome to use CI, just be conscious that this is a shared
6964resource with limited concurrency.
7065Try not to enable too many jobs at once (one or two should be sufficient in
7166most cases).
7267
73- [ `src/ci/github-actions/ci.yml` ] : https://github.com/rust-lang/rust/blob/master/src/ci/github-actions/ci.yml
74- [ `.github/workflows/ci.yml` ] : https://github.com/rust-lang/rust/blob/master/.github/workflows/ci.yml#L1
68+ [ `src/ci/github-actions/jobs.yml` ] : https://github.com/rust-lang/rust/blob/master/src/ci/github-actions/jobs.yml
69+ [ `.github/workflows/ci.yml` ] : https://github.com/rust-lang/rust/blob/master/.github/workflows/ci.yml
70+ [ `src/ci/github-actions/calculate-job-matrix.py` ] : https://github.com/rust-lang/rust/blob/master/src/ci/github-actions/calculate-job-matrix.py
0 commit comments