Skip to content
bell

GitHub Action

Dartanalyzer annotations

v1.1 Latest version

Dartanalyzer annotations

bell

Dartanalyzer annotations

Creates annotations from dartanalyzer outputs

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Dartanalyzer annotations

uses: kitek/dartanalyzer-annotations-action@v1.1

Learn more about this action in kitek/dartanalyzer-annotations-action

Choose a version

dartanalyzer-annotations-action

Creates annotations from dartanalyzer output. This action requires installed dartanalyzer - you can provide it by adding another action for example flutter-action. Recommended is to use with one of the lint rulesets:

Inputs

check_name

Required The name of the check run to add annotations to. This should be the same as the job that uses this action.

commit_sha

Required Commit to attach the check to. If the trigger is push, this should just be github.sha. If the trigger is pull_request, this should be the github.event.pull_request.head.sha.

working-directory

Working directory to run analysis. If not specified will use the root project folder.

Example usage

On pull requests branch:

name: Run lint on pull requests
on:
  pull_request:
    branches: [ develop ]

jobs:
  lint:
    name: Check code style
    runs-on: ubuntu-latest
    steps:
      - name: Checkout source code
        uses: actions/checkout@v2
      - name: Install Flutter
        uses: subosito/flutter-action@v1
        with:
          channel: 'stable'
      - name: Get packages in a Flutter project
        run: flutter pub get
      - name: Run lint
        uses: kitek/dartanalyzer-annotations-action@v1  
        env:
          GITHUB_TOKEN: ${{ github.token }}
        with:
          check_name: 'Check code style'
          commit_sha: ${{ github.event.pull_request.head.sha }}

On develop branch:

name: Build and release app to beta testers

on:
  push:
    branches: [ develop ]
jobs:
  build-android:
    name: Build Android App
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Action
        uses: actions/checkout@v2
      - name: Install Flutter
        uses: subosito/flutter-action@v1
        with:
          channel: 'stable'
      - name: Get packages in a Flutter project
        run: flutter pub get
      - name: Run lint
        uses: kitek/dartanalyzer-annotations-action@v1  
        env:
          GITHUB_TOKEN: ${{ github.token }}
        with:
          check_name: 'Build Android App'
          commit_sha: ${{ github.sha }}

Example output:

alt text