Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zgosalvez/github-actions-analyze-dart
A Github Action to analyze your project's Dart code
https://github.com/zgosalvez/github-actions-analyze-dart
actions dart flutter github github-actions
Last synced: about 3 hours ago
JSON representation
A Github Action to analyze your project's Dart code
- Host: GitHub
- URL: https://github.com/zgosalvez/github-actions-analyze-dart
- Owner: zgosalvez
- License: mit
- Created: 2020-12-13T03:00:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-09T07:20:01.000Z (3 days ago)
- Last Synced: 2025-02-09T07:34:44.793Z (3 days ago)
- Topics: actions, dart, flutter, github, github-actions
- Language: JavaScript
- Homepage: https://github.com/marketplace/actions/analyze-dart
- Size: 1.63 MB
- Stars: 24
- Watchers: 2
- Forks: 13
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# 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](#common-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).### Inputs
For more information on these inputs, see the [Workflow syntax for GitHub Actions](https://docs.github.com/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepswith)- `fail-on-infos`: The action fails if any info was found. This will always fail on errors. Optional. Default: `false`
- `fail-on-warnings`: The action fails if any warning was found. This will always fail on errors. Optional. Default: `false`
- `working-directory`: The working directory. Optional. Default: `./`
- `line-length`: The maximum line length. Optional. The formatter will use its default: `80`### Outputs
None.Sample Workflow Summary:
![Screenshot](assets/annotations.png)Sample Files Changed:
![Screenshot](assets/files_changed.png)### Dart workflow
1. Your workflow must install Dart before using this action. Suggestion: [Dart starter workflow](https://github.com/actions/starter-workflows/blob/main/ci/dart.yml).
2. Use the action. For example:
```yaml
on: pushname: Sample Workflow
jobs:
build:
name: Example
runs-on: ubuntu-latest
container:
image: google/dart:latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: dart pub get
- name: Analyze Dart
uses: zgosalvez/github-actions-analyze-dart@v3
```### Flutter workflow
1. Your workflow must install Flutter before using this action. Suggestion: [Flutter action](https://github.com/marketplace/actions/flutter-action).
2. Use the action. For example:
```yaml
on: pushname: Sample Workflow
jobs:
build:
name: Example
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Flutter
uses: subosito/flutter-action@v1
- run: flutter pub get
- name: Analyze Dart
uses: zgosalvez/github-actions-analyze-dart@v3
```### Custom Workflow
After following the [common workflow](#common-workflow) above, lint rules can be customized. For more details see:
- [`pedantic`](https://github.com/dart-lang/pedantic) for rules enforced internally at Google
- [`effective_dart`](https://github.com/tenhobi/effective_dart) for rules corresponding to the [Effective Dart](https://dart.dev/guides/language/effective-dart) style guide### Flutter Workflows
This is used in my opinionated [GitHub Actions: Flutter Workflows](https://github.com/zgosalvez/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](LICENSE.md)