Skip to content

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.

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 shows detail output such as the commands that are run. It works anywhere in the arguments and is not passed on to the lane:

Terminal window
dart run dartlane/lanes.dart beta --verbose

Example: 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.

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.

Not built yet, because only GitHub Actions is in scope for 0.1.0. When a second platform is needed:

  1. Replace the githubActions flag on LaneLogger with a small formatter that turns an error or a warning into that platform’s line.
  2. Choose the formatter in LaneLogger.fromEnvironment from the platform’s environment variable.
  3. 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.