Skip to content

Commit 40bc9ee

Browse files
authored
Merge pull request #2999 from embg/ci_instructions_update
Update CI documentation
2 parents ef1eafd + 8250faa commit 40bc9ee

File tree

1 file changed

+38
-53
lines changed

1 file changed

+38
-53
lines changed

CONTRIBUTING.md

+38-53
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ Our contribution process works in three main stages:
6868
```
6969
2. Code Review and CI tests
7070
* Ensure CI tests pass:
71-
* Before sharing anything to the community, make sure that all CI tests pass on your local fork.
72-
See our section on setting up your CI environment for more information on how to do this.
71+
* Before sharing anything to the community, create a pull request in your own fork against the dev branch
72+
and make sure that all GitHub Actions CI tests pass. See the Continuous Integration section below for more information.
7373
* Ensure that static analysis passes on your development machine. See the Static Analysis section
7474
below to see how to do this.
7575
* Create a pull request:
@@ -140,6 +140,42 @@ It can be useful to look at additional static analyzers once in a while (and we
140140
141141
This is different from running a static analyzer once in a while, looking at the output, and __cherry picking__ a few warnings that seem helpful, either because they detected a genuine risk of bug, or because it helps expressing the code in a way which is more readable or more difficult to misuse. These kind of reports can be useful, and are accepted.
142142
143+
## Continuous Integration
144+
CI tests run every time a pull request (PR) is created or updated. The exact tests
145+
that get run will depend on the destination branch you specify. Some tests take
146+
longer to run than others. Currently, our CI is set up to run a short
147+
series of tests when creating a PR to the dev branch and a longer series of tests
148+
when creating a PR to the release branch. You can look in the configuration files
149+
of the respective CI platform for more information on what gets run when.
150+
151+
Most people will just want to create a PR with the destination set to their local dev
152+
branch of zstd. You can then find the status of the tests on the PR's page. You can also
153+
re-run tests and cancel running tests from the PR page or from the respective CI's dashboard.
154+
155+
Almost all of zstd's CI runs on GitHub Actions (configured at `.github/workflows`), which will automatically run on PRs to your
156+
own fork. A small number of tests run on other services (e.g. Travis CI, Circle CI, Appveyor).
157+
These require work to set up on your local fork, and (at least for Travis CI) cost money.
158+
Therefore, if the PR on your local fork passes GitHub Actions, feel free to submit a PR
159+
against the main repo.
160+
161+
### Third-party CI
162+
A small number of tests cannot run on GitHub Actions, or have yet to be migrated.
163+
For these, we use a variety of third-party services (listed below). It is not necessary to set
164+
these up on your fork in order to contribute to zstd; however, we do link to instructions for those
165+
who want earlier signal.
166+
167+
| Service | Purpose | Setup Links | Config Path |
168+
|-----------|------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
169+
| Travis CI | Used for testing on non-x86 architectures such as PowerPC | https://docs.travis-ci.com/user/tutorial/#to-get-started-with-travis-ci-using-github <br> https://github.com/marketplace/travis-ci | `.travis.yml` |
170+
| AppVeyor | Used for some Windows testing (e.g. cygwin, mingw) | https://www.appveyor.com/blog/2018/10/02/github-apps-integration/ <br> https://github.com/marketplace/appveyor | `appveyor.yml` |
171+
| Cirrus CI | Used for testing on FreeBSD | https://github.com/marketplace/cirrus-ci/ | `.cirrus.yml` |
172+
| Circle CI | Historically was used to provide faster signal,<br/> but we may be able to migrate these to Github Actions | https://circleci.com/docs/2.0/getting-started/#setting-up-circleci <br> https://youtu.be/Js3hMUsSZ2c <br> https://circleci.com/docs/2.0/enable-checks/ | `.circleci/config.yml` |
173+
174+
Note: the instructions linked above mostly cover how to set up a repository with CI from scratch.
175+
The general idea should be the same for setting up CI on your fork of zstd, but you may have to
176+
follow slightly different steps. In particular, please ignore any instructions related to setting up
177+
config files (since zstd already has configs for each of these services).
178+
143179
## Performance
144180
Performance is extremely important for zstd and we only merge pull requests whose performance
145181
landscape and corresponding trade-offs have been adequately analyzed, reproduced, and presented.
@@ -339,57 +375,6 @@ counter `L1-dcache-load-misses`
339375
340376
TODO
341377
342-
343-
## Setting up continuous integration (CI) on your fork
344-
Zstd uses a number of different continuous integration (CI) tools to ensure that new changes
345-
are well tested before they make it to an official release. Specifically, we use the platforms
346-
travis-ci, circle-ci, and appveyor.
347-
348-
Changes cannot be merged into the main dev branch unless they pass all of our CI tests.
349-
The easiest way to run these CI tests on your own before submitting a PR to our dev branch
350-
is to configure your personal fork of zstd with each of the CI platforms. Below, you'll find
351-
instructions for doing this.
352-
353-
### travis-ci
354-
Follow these steps to link travis-ci with your github fork of zstd
355-
356-
1. Make sure you are logged into your github account
357-
2. Go to https://travis-ci.org/
358-
3. Click 'Sign in with Github' on the top right
359-
4. Click 'Authorize travis-ci'
360-
5. Click 'Activate all repositories using Github Apps'
361-
6. Select 'Only select repositories' and select your fork of zstd from the drop down
362-
7. Click 'Approve and Install'
363-
8. Click 'Sign in with Github' again. This time, it will be for travis-pro (which will let you view your tests on the web dashboard)
364-
9. Click 'Authorize travis-pro'
365-
10. You should have travis set up on your fork now.
366-
367-
### circle-ci
368-
TODO
369-
370-
### appveyor
371-
Follow these steps to link circle-ci with your github fork of zstd
372-
373-
1. Make sure you are logged into your github account
374-
2. Go to https://www.appveyor.com/
375-
3. Click 'Sign in' on the top right
376-
4. Select 'Github' on the left panel
377-
5. Click 'Authorize appveyor'
378-
6. You might be asked to select which repositories you want to give appveyor permission to. Select your fork of zstd if you're prompted
379-
7. You should have appveyor set up on your fork now.
380-
381-
### General notes on CI
382-
CI tests run every time a pull request (PR) is created or updated. The exact tests
383-
that get run will depend on the destination branch you specify. Some tests take
384-
longer to run than others. Currently, our CI is set up to run a short
385-
series of tests when creating a PR to the dev branch and a longer series of tests
386-
when creating a PR to the release branch. You can look in the configuration files
387-
of the respective CI platform for more information on what gets run when.
388-
389-
Most people will just want to create a PR with the destination set to their local dev
390-
branch of zstd. You can then find the status of the tests on the PR's page. You can also
391-
re-run tests and cancel running tests from the PR page or from the respective CI's dashboard.
392-
393378
## Issues
394379
We use GitHub issues to track public bugs. Please ensure your description is
395380
clear and has sufficient instructions to be able to reproduce the issue.

0 commit comments

Comments
 (0)