Add pana job

This commit is contained in:
Foti Dim
2025-11-10 21:11:40 +01:00
parent 5689e551f7
commit b52ca9ee84
6 changed files with 66 additions and 45 deletions
+3 -4
View File
@@ -1,9 +1,8 @@
name: Build web app
on:
push:
branches: [ "main" ]
branches: ["main"]
workflow_dispatch:
jobs:
@@ -14,7 +13,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
- run: flutter --version
- name: Cache pub dependencies
@@ -28,7 +27,7 @@ jobs:
run: flutter pub get
- name: Build Web App
run: cd example && flutter build web --base-href=/universal_ble/
run: cd example && flutter build web --base-href=/${{ github.event.repository.name }}/
- name: Deploy to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
+58
View File
@@ -0,0 +1,58 @@
name: Pull Request
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: flutter pub get
- name: Analyze project source
run: flutter analyze
- name: Run Flutter tests
run: flutter test
- name: Install Chrome
uses: browser-actions/setup-chrome@latest
- name: Run Flutter tests on Chrome
uses: coactions/setup-xvfb@v1
with:
run: flutter test --platform chrome
pana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- name: Install Dependencies
run: |
flutter packages get
flutter pub global activate pana
sudo apt-get install webp
- name: Verify Pub 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]; TOTAL=SCORE_ARR[1]
if [ -z "$1" ]; then MINIMUM_SCORE=TOTAL; else MINIMUM_SCORE=$1; fi
if (( $SCORE < $MINIMUM_SCORE )); then echo "minimum score $MINIMUM_SCORE was not met!"; exit 1; fi
@@ -1,36 +0,0 @@
name: BleUuidParser Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: flutter pub get
- name: Analyze project source
run: flutter analyze
- name: Run Flutter tests
run: flutter test
- name: Install Chrome
uses: browser-actions/setup-chrome@latest
- name: Run Flutter tests on Chrome
uses: coactions/setup-xvfb@v1
with:
run: flutter test --platform chrome
+1 -1
View File
@@ -44,7 +44,7 @@ android {
applicationId "com.navideck.universal_ble_example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
minSdkVersion flutter.minSdkVersion
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
+2 -2
View File
@@ -20,9 +20,9 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/universal_ble/darwin
SPEC CHECKSUMS:
device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f
device_info_plus: b0fafc687fb901e2af612763340f1b0d4352f8e5
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
universal_ble: ff19787898040d721109c6324472e5dd4bc86adc
PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3
+2 -2
View File
@@ -235,7 +235,7 @@ class UniversalBle {
}
/// Write a characteristic value.
/// To write a characteristic value without response, set [withoutResponse] to [true].
/// To write a characteristic value without response, set [withoutResponse] to `true`.
static Future<void> write(
String deviceId,
String service,
@@ -364,7 +364,7 @@ class UniversalBle {
/// Get connected devices to the system (connected by any app).
/// Use [withServices] to filter devices by services.
/// On `Apple`, [withServices] is required to get any connected devices. If not passed, several [18XX] generic services will be set by default.
/// On `Apple`, [withServices] is required to get any connected devices. If not passed, several 18XX generic services will be set by default.
/// On `Android`, `Linux` and `Windows`, if [withServices] is used, then internally all services will be discovered for each device first (either by connecting or by using cached services).
/// Not supported on `Web`.
static Future<List<BleDevice>> getSystemDevices({