Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: code-analysis

on:
push:
paths:
- '**.dart'
- 'pubspec.yaml'
- '.github/workflows/code-analysis.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
setup:
runs-on: ubuntu-24.04
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: make ssh directory
run: |
mkdir -p $HOME/.ssh/

- uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action

- uses: subosito/flutter-action@v2.18.0
with:
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
cache: true

- name: restore pubspec dependencies cache
uses: actions/cache@v4
id: pubspec_cache_id
with:
path: |
${{ env.FLUTTER_HOME }}/.pub-cache
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.lock') }}

- name: install dependencies
if: ${{ steps.pubspec_cache_id.outputs.cache-hit != 'true' }}
run: flutter pub get

lint:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: setup

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: kuhnroyal/flutter-fvm-config-action@v3
id: fvm-config-action

- uses: subosito/flutter-action@v2.18.0
with:
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
cache: true

- name: restore pubspec dependencies cache
uses: actions/cache@v4
id: pubspec_cache_id
with:
path: |
${{ env.FLUTTER_HOME }}/.pub-cache
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.lock') }}

- run: dart format --set-exit-if-changed .
- run: flutter analyze .