Running lanes on CI
Lanes run the same way on a laptop and on CI. The runner only changes two things when it detects a CI environment.
What changes on CI
Section titled “What changes on CI”| Behavior | When | Effect |
|---|---|---|
| No prompts | CI=true or GITHUB_ACTIONS=true, or no terminal attached |
confirm never asks. It returns its default value, so a lane never hangs waiting for input. |
| Annotations | GITHUB_ACTIONS=true |
error and warn messages print as ::error::message and ::warning::message, which GitHub shows in the run summary. |
Everything else is the same everywhere: log levels, --verbose, error messages
and exit codes.
Verbose output
Section titled “Verbose output”--verbose shows detail output such as the commands that are run. It works
anywhere in the arguments and is not passed on to the lane:
dart run dartlane/lanes.dart beta --verboseExample: ship the beta lane from GitHub Actions
Section titled “Example: ship the beta lane from GitHub Actions”examples/github-actions-beta.yaml installs
Java and Flutter, writes the Firebase key from a repository secret
(FIREBASE_SERVICE_ACCOUNT) to a temporary file, and runs the beta lane from
the quick start. It runs the lanes file directly with
dart run dartlane/lanes.dart beta, so the Dartlane CLI does not need to be
installed on CI. Copy it to .github/workflows/beta.yaml in your app and follow
the setup notes at the top of the file.
Supported platforms
Section titled “Supported platforms”| Platform | No prompts | Annotations |
|---|---|---|
| GitHub Actions | Yes | Yes |
Other platforms that set CI=true (for example GitLab CI, CircleCI, Travis CI, Buildkite) |
Yes | No, plain output |
Platforms that do not set CI (for example Azure Pipelines sets TF_BUILD) |
Only if no terminal is attached, which is usual on CI | No, plain output |
Annotations are GitHub-specific because each platform uses its own format:
| Platform | Format |
|---|---|
| GitHub Actions | ::error::message |
| Azure Pipelines | ##vso[task.logissue type=error]message |
| TeamCity | ##teamcity[message text='...' status='ERROR'] |
Other platforms either have no equivalent for errors or only offer collapsible log sections.
Adding another platform
Section titled “Adding another platform”Not built yet, because only GitHub Actions is in scope for 0.1.0. When a second platform is needed:
- Replace the
githubActionsflag onLaneLoggerwith a small formatter that turns an error or a warning into that platform’s line. - Choose the formatter in
LaneLogger.fromEnvironmentfrom the platform’s environment variable. - Add the platform to the tables above and test the formatter like the
GitHub one in
packages/dartlane_core/test/lane_logger_test.dart.
Only LaneLogger and fromEnvironment know about the flag, so the change stays
inside them.
