Other CI providers
Every CI system the reporter recognises, what it reads from each, and what to set where it cannot.
The reporter recognises these providers by their own variables. For each it reads a run ID shared by all shards, a branch and a commit; the commit message and author come from git for that commit. Guides for three of them: GitHub Actions, GitLab CI and Azure Pipelines.
Checks and pull-request comments are GitHub only today: Squally posts them to GitHub repositories, through the Squally GitHub App, whatever CI ran the tests - no other host gets a commit status or a comment.
| Provider | Recognised by | Run ID | Branch | Commit | Re-run or retry |
|---|---|---|---|---|---|
| GitHub Actions | GITHUB_ACTIONS |
GITHUB_RUN_ID-GITHUB_RUN_ATTEMPT |
GITHUB_REF_NAME; pull requests: GITHUB_HEAD_REF |
GITHUB_SHA; pull requests: the head commit |
new run, of the shards that re-ran - see GitHub Actions |
| GitLab CI | GITLAB_CI |
CI_PIPELINE_ID |
CI_COMMIT_BRANCH; merge requests: source branch |
CI_COMMIT_SHA - see GitLab CI |
same ID |
| CircleCI | CIRCLECI |
CIRCLE_WORKFLOW_ID |
CIRCLE_BRANCH |
CIRCLE_SHA1 |
new run |
| Jenkins | BUILD_TAG starting with jenkins- |
BUILD_TAG |
CHANGE_BRANCH, else BRANCH_NAME, else GIT_BRANCH |
GIT_COMMIT |
new run |
| Azure Pipelines | TF_BUILD |
BUILD_BUILDID |
BUILD_SOURCEBRANCH; pull requests: SYSTEM_PULLREQUEST_SOURCEBRANCH |
BUILD_SOURCEVERSION; pull requests: SYSTEM_PULLREQUEST_SOURCECOMMITID |
same ID |
| Bitbucket Pipelines | BITBUCKET_BUILD_NUMBER |
BITBUCKET_BUILD_NUMBER |
BITBUCKET_BRANCH |
BITBUCKET_COMMIT |
same ID |
| Buildkite | BUILDKITE |
BUILDKITE_BUILD_ID |
BUILDKITE_BRANCH |
BUILDKITE_COMMIT |
same ID |
| TeamCity | TEAMCITY_VERSION |
none - set SQUALLY_CI_RUN_ID |
from git | BUILD_VCS_NUMBER |
- |
| AWS CodeBuild | CODEBUILD_BUILD_ID |
CODEBUILD_BUILD_ID |
CODEBUILD_WEBHOOK_HEAD_REF |
CODEBUILD_RESOLVED_SOURCE_VERSION |
new run |
| Travis CI | TRAVIS |
TRAVIS_BUILD_ID |
TRAVIS_BRANCH; pull requests: TRAVIS_PULL_REQUEST_BRANCH |
TRAVIS_COMMIT; pull requests: TRAVIS_PULL_REQUEST_SHA |
same ID |
| Drone | DRONE |
DRONE_BUILD_NUMBER |
DRONE_BRANCH; pull requests: DRONE_SOURCE_BRANCH |
DRONE_COMMIT_SHA, else DRONE_COMMIT |
new run |
On every provider a tag build has no branch, and a missing commit variable
falls back to git rev-parse HEAD.
Several jobs in one CI run
Section titled “Several jobs in one CI run”The run ID is shared by everything in one CI run, also by jobs that are not
shards of each other. Give each such job its own SQUALLY_CI_JOB_KEY
(squally-reporter 0.11.0): the reporter adds it after the provider’s ID -
<run ID>-<key>, on GitHub Actions <GITHUB_RUN_ID>-<key>-<GITHUB_RUN_ATTEMPT> -
and each job becomes a run of its own. See
Sharded runs. With
SQUALLY_CI_RUN_ID set, that ID wins and the key is not added to it.
The link to the CI run
Section titled “The link to the CI run”Since squally-reporter 0.11.0, Squally shows a View in CI link on the run’s page, to the CI run’s page - never one job’s. Six providers send one:
| Provider | Link from |
|---|---|
| GitHub Actions | GITHUB_SERVER_URL/GITHUB_REPOSITORY/actions/runs/GITHUB_RUN_ID/attempts/GITHUB_RUN_ATTEMPT |
| GitLab CI | CI_PIPELINE_URL |
| Jenkins | BUILD_URL, only when Jenkins is served over https |
| Buildkite | BUILDKITE_BUILD_URL |
| Travis CI | TRAVIS_BUILD_WEB_URL |
| Drone | DRONE_BUILD_LINK |
The others send none, and their runs have no View in CI. For runs of an
older reporter, Squally builds the GitHub Actions link itself when the
project has exactly one linked repository and the run ID has the reporter’s
default shape, <GITHUB_RUN_ID>-<GITHUB_RUN_ATTEMPT>. See
Reporter setup.
Where a provider falls short
Section titled “Where a provider falls short”- TeamCity exposes no build ID as an environment variable. Without
SQUALLY_CI_RUN_ID, every shard becomes its own run. - AWS CodeBuild batch builds share no ID: each build of a batch is its own run.
- Re-runs that keep the same ID (“same ID” above) send their results to the
run the first attempt created; a job key stays the same too. When both
attempts ran squally-reporter 0.11.0, Squally refuses the re-run at its
start (
ci_run_reusedonce the first attempt’s run has ended,ci_run_collisionwhile it still runs); otherwise it refuses its results once that run is complete. The reporter says so once and sends nothing more. The test job’s exit code is not affected. See Troubleshooting.
Any other CI
Section titled “Any other CI”Set CI=true (or 1) and a run ID that all shards of one CI run share -
and that is different for every CI run, such as your CI’s build number
(plus the attempt, if it re-runs a build under the same number):
CI=trueSQUALLY_CI_RUN_ID=your-build-idSQUALLY_INGEST_KEY=your-project-ingest-keySQUALLY_INGEST_URL is needed only for a Squally other than
https://app.squally.dev. Branch, commit, message and author then come from
git. Without
SQUALLY_CI_RUN_ID, each shard reports as its own run. With a value that
repeats - a constant, or the commit SHA - only the first CI run is recorded;
every later one is refused at its start (ci_run_reused, see
Troubleshooting). Without CI=true, the
run is local: it counts only under Local and All,
not in the CI numbers.