-
Notifications
You must be signed in to change notification settings - Fork 10
37 lines (30 loc) · 998 Bytes
/
code_metrics.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Code metrics
# Controls when the workflow will run
on:
# Triggers the workflow on pull request events but only for the master branch
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
code_metrics:
name: "Code Metrics"
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Setup Flutter
uses: subosito/[email protected]
- name: Cache dependencies
uses: actions/[email protected]
with:
path: |
$PUB_CACHE
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Get dependencies
run: flutter pub get
- name: Check for unused files and code
run: |
dart run dart_code_metrics:metrics check-unused-files lib || exit 1
dart run dart_code_metrics:metrics check-unused-code lib || exit 1