-
-
Notifications
You must be signed in to change notification settings - Fork 16
49 lines (42 loc) · 1.33 KB
/
pana.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
#Source: https://github.com/VeryGoodOpenSource/very_good_workflows/blob/v1/.github/workflows/pana.yml
name: Oidc Pana Workflow
on:
workflow_call:
inputs:
min_score:
required: false
type: number
default: 120
pana_version:
required: false
type: string
runs_on:
required: false
type: string
default: "ubuntu-latest"
working_directory:
required: false
type: string
default: "."
jobs:
build:
defaults:
run:
working-directory: ${{inputs.working_directory}}
runs-on: ${{inputs.runs_on}}
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: 📦 Install Pana
run: flutter pub global activate pana ${{inputs.pana_version}}
- name: 📊 Verify Pana Score
run: |
PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p")
echo "Score: $PANA_SCORE"
IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0];
if (( $SCORE < ${{inputs.min_score}} )); then echo "The minimum score of ${{inputs.min_score}} was not met!"; exit 1; fi