Skip to content

Commit 483cd7e

Browse files
authoredMar 13, 2025
feat: add pana checks (#896)
* feat: add pana checks * fix: move pana inside actions directory * fix: fix package name * chore: upgrade pana score
1 parent 628225f commit 483cd7e

File tree

3 files changed

+111
-1
lines changed

3 files changed

+111
-1
lines changed
 

‎.github/actions/pana/action.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Pana Workflow
2+
3+
inputs:
4+
min_score:
5+
required: false
6+
type: number
7+
default: 120
8+
pana_version:
9+
required: false
10+
type: string
11+
runs_on:
12+
required: false
13+
type: string
14+
default: "ubuntu-latest"
15+
working_directory:
16+
required: false
17+
type: string
18+
default: "."
19+
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Temporary Override Local Dependencies
24+
uses: mikefarah/yq@master
25+
with:
26+
cmd: |
27+
yq eval '.dependencies.stream_video = {"path": "../stream_video"}' -i packages/stream_video_flutter/pubspec.yaml
28+
yq eval '.dependencies.stream_video = {"path": "../stream_video"}' -i packages/stream_video_push_notification/pubspec.yaml
29+
30+
- name: Install Flutter
31+
uses: subosito/flutter-action@v2
32+
with:
33+
cache: true
34+
channel: stable
35+
flutter-version: "3.x"
36+
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
37+
38+
- name: Install Pana
39+
working-directory: ${{ inputs.working_directory }}
40+
shell: bash
41+
run: flutter pub global activate pana ${{inputs.pana_version}}
42+
43+
- name: Verify Pana Score
44+
working-directory: ${{ inputs.working_directory }}
45+
shell: bash
46+
run: |
47+
PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p")
48+
echo "Score: $PANA_SCORE"
49+
IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0];
50+
if (( $SCORE < ${{inputs.min_score}} )); then echo "The minimum score of ${{inputs.min_score}} was not met!"; exit 1; fi

‎.github/workflows/pana.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: pana
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
stream_video:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: 📚 Git Checkout
20+
uses: actions/checkout@v4
21+
- name: 📊 Verify Pana Score
22+
uses: ./.github/actions/pana
23+
with:
24+
working_directory: packages/stream_video
25+
min_score: 120
26+
27+
stream_video_flutter:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: 📚 Git Checkout
31+
uses: actions/checkout@v4
32+
- name: 📊 Verify Pana Score
33+
uses: ./.github/actions/pana
34+
with:
35+
working_directory: packages/stream_video_flutter
36+
min_score: 150
37+
38+
stream_video_push_notification:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: 📚 Git Checkout
42+
uses: actions/checkout@v4
43+
- name: 📊 Verify Pana Score
44+
uses: ./.github/actions/pana
45+
with:
46+
working_directory: packages/stream_video_push_notification
47+
min_score: 140
48+
49+
stream_video_screen_sharing:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: 📚 Git Checkout
53+
uses: actions/checkout@v4
54+
- name: 📊 Verify Pana Score
55+
uses: ./.github/actions/pana
56+
with:
57+
working_directory: packages/stream_video_screen_sharing
58+
min_score: 140

‎packages/stream_video_screen_sharing/pubspec.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: stream_video_screen_sharing
2-
description: "Official Screen Sharing Plugin for Stream Video Flutter."
2+
description: >
3+
Official Screen Sharing Plugin for Stream Video Flutter that enables sharing device screens
4+
during video calls.
35
version: 0.8.3
46
homepage: https://getstream.io/video/
57
repository: https://github.com/GetStream/stream-video-flutter

0 commit comments

Comments
 (0)