2
2
3
3
## Testing infrastructure
4
4
5
- <!-- date-check: oct 2022 -->
5
+ <!-- date-check: may 2024 -->
6
6
When a Pull Request is opened on GitHub, [ GitHub Actions] will automatically
7
7
launch 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).
9
9
In essence, each runs ` ./x test ` with various different options.
10
10
11
11
The integration bot [ bors] is used for coordinating merges to the master branch.
12
12
When a PR is approved, it goes into a [ queue] where merges are tested one at a
13
13
time 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) .
16
16
Most platforms only run the build steps, some run a restricted set of tests,
17
17
only a subset run the full suite of tests (see Rust's [ platform tiers] ).
18
18
19
- If everything passes, then all of the distribution artifacts that were
19
+ If everything passes, then all the distribution artifacts that were
20
20
generated during the CI run are published.
21
21
22
22
[ GitHub Actions ] : https://github.com/rust-lang/rust/actions
23
23
[ 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
25
25
[ queue ] : https://bors.rust-lang.org/queue/rust
26
26
[ platform tiers ] : https://forge.rust-lang.org/release/platform-support.html#rust-platform-support
27
27
@@ -40,35 +40,31 @@ For example, if a Windows build fails, but you don't have access to a Windows
40
40
machine, you can try running the Windows job that failed on CI within your PR
41
41
after pushing a possible fix.
42
42
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.
48
49
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 .
53
54
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.
55
56
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 ` .
59
58
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 ` ] .
62
62
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
69
64
resource with limited concurrency.
70
65
Try not to enable too many jobs at once (one or two should be sufficient in
71
66
most cases).
72
67
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