zgosalvez / github-actions-analyze-dart

A Github Action to analyze your project's Dart code
https://github.com/marketplace/actions/analyze-dart
MIT License
23 stars 12 forks source link
actions dart flutter github github-actions

GitHub Action — Analyze Dart

This GitHub Action (written in JavaScript) allows you to leverage GitHub Actions to analyze your Dart project's Dart code, including Flutter. This runs both the dart analyze and dartfmt commands under the hood.

Usage

Pre-requisites

Create a workflow .yml file in your .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

Inputs

For more information on these inputs, see the Workflow syntax for GitHub Actions

Outputs

None.

Sample Workflow Summary: Screenshot

Sample Files Changed: Screenshot

Dart workflow

  1. Your workflow must install Dart before using this action. Suggestion: Dart starter workflow.
  2. Use the action. For example:
    
    on: push

name: Sample Workflow

jobs: build: name: Example runs-on: ubuntu-latest container: image: google/dart:latest steps:

Flutter workflow

  1. Your workflow must install Flutter before using this action. Suggestion: Flutter action.
  2. Use the action. For example:
    
    on: push

name: Sample Workflow

jobs: build: name: Example runs-on: ubuntu-latest steps:

Custom Workflow

After following the common workflow above, lint rules can be customized. For more details see:

Flutter Workflows

This is used in my opinionated GitHub Actions: Flutter Workflows repository along with other actions for a complete end-to-end DevOps experience.

License

The scripts and documentation in this project are released under the MIT License