Skip to content

Quickstart

Add your first workflow to a familiar project. Start by running analysis and tests locally.

This guide adds a Dart workflow to a Flutter project and runs it locally.

  • Install the Flutter / Dart SDK.
  • Have a project where you can run flutter analyze and flutter test.
  • Open a terminal in the project root.

The same approach works for Dart packages. Use dart pub add to add the SDK, and dart analyze and dart test for checks.

Add the workflow SDK to your Flutter project.

Terminal window
flutter pub add --dev openci_workflow

The service is called GenuineCI. The workflow package is named openci_workflow.

Create an openci/ directory at the repository root and add flutter_ci.dart inside it.

import 'package:openci_workflow/openci_workflow.dart';
Future<void> main() async {
final ci = await OpenCI.init(
workflowName: 'Flutter CI',
ciTriggers: [
CITrigger.push(branch: 'main'),
CITrigger.pullRequest(branch: 'main'),
],
);
await ci.run('flutter pub get');
await ci.flutter.staticAnalysis();
await ci.flutter.unitTests();
}

Set the name and triggers with OpenCI.init, then use await to run steps in order. If analysis or tests fail, the workflow exits with a failure too.

Run the file as a regular Dart script.

Terminal window
dart run openci/flutter_ci.dart

Analysis and test results appear in the terminal. Check that your workflow works in your own environment before sending it to CI.

Local runs use your installed Flutter SDK and build tools. Prepare the SDKs and commands your workflow needs in advance.

Once your repository, GitHub App connection, team, and build machines are ready, commit the workflow and push it to the target branch. The triggers in Dart files under openci/ are matched against GitHub events.

Open the dashboard to check your builds. See Triggers for event configuration.