Many continuous integration services like GitLab and Travis-CI have the $CI environment variable set in their execution environments. Some tools such as Python pipenv for example will check for the presence of the $CI variable and automatically configure settings approriate for a CI runtime environment.
Some tests should only be run on CI, others never on CI. Some tests should only selected or not on certain CIs.
Please include one called CI plus another to identify as GitHub Actions.
Here’s a summary of the truthy env vars from some popular CIs:
- AppVeyor: CI, APPVEYOR
- Azure Pipelines: TF_BUILD
- CircleCI: CI, CIRCLECI
- GitLab CI/CD: CI, CI_SERVER, GITLAB_CI
- Travis CI: CI, CONTINUOUS_INTEGRATION, TRAVIS
We already have GITHUB_ACTIONS, GITHUB_WORKFLOW, GITHUB_WORKSPACE, GITHUB_SHA, and about a dozen of others to make sure we’re running under GitHub, so this part is covered IMHO. Only CI is missing
Thanks, CI would still be good.
Here’s the docs about those (and it’s GITHUB_ACTION without an S):
There’s two distinct values here. GITHUB_ACTION is the name of the action that’s running, if any (and there may not be one). GITHUB_ACTIONS is always set to show that you’re running within GitHub Actions.
Thanks for clarifying. Please could you add GITHUB_ACTIONS to the the docs?
Yes, an update is coming soon. Thanks!