Skip to content

Commit b52ca9e

Browse files
committed
Add pana job
1 parent 5689e55 commit b52ca9e

6 files changed

Lines changed: 66 additions & 45 deletions

File tree

.github/workflows/build_web_app.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
21
name: Build web app
32

43
on:
54
push:
6-
branches: [ "main" ]
5+
branches: ["main"]
76
workflow_dispatch:
87

98
jobs:
@@ -14,7 +13,7 @@ jobs:
1413
- name: Setup Flutter
1514
uses: subosito/flutter-action@v2
1615
with:
17-
channel: 'stable'
16+
channel: "stable"
1817
- run: flutter --version
1918

2019
- name: Cache pub dependencies
@@ -28,7 +27,7 @@ jobs:
2827
run: flutter pub get
2928

3029
- name: Build Web App
31-
run: cd example && flutter build web --base-href=/universal_ble/
30+
run: cd example && flutter build web --base-href=/${{ github.event.repository.name }}/
3231

3332
- name: Deploy to GitHub Pages 🚀
3433
uses: JamesIves/github-pages-deploy-action@v4

.github/workflows/pull_request.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Pull Request
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Flutter
17+
uses: subosito/flutter-action@v2
18+
with:
19+
channel: stable
20+
21+
- name: Install dependencies
22+
run: flutter pub get
23+
24+
- name: Analyze project source
25+
run: flutter analyze
26+
27+
- name: Run Flutter tests
28+
run: flutter test
29+
30+
- name: Install Chrome
31+
uses: browser-actions/setup-chrome@latest
32+
33+
- name: Run Flutter tests on Chrome
34+
uses: coactions/setup-xvfb@v1
35+
with:
36+
run: flutter test --platform chrome
37+
38+
pana:
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- uses: subosito/flutter-action@v2
45+
46+
- name: Install Dependencies
47+
run: |
48+
flutter packages get
49+
flutter pub global activate pana
50+
sudo apt-get install webp
51+
52+
- name: Verify Pub Score
53+
run: |
54+
PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p")
55+
echo "score: $PANA_SCORE"
56+
IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0]; TOTAL=SCORE_ARR[1]
57+
if [ -z "$1" ]; then MINIMUM_SCORE=TOTAL; else MINIMUM_SCORE=$1; fi
58+
if (( $SCORE < $MINIMUM_SCORE )); then echo "minimum score $MINIMUM_SCORE was not met!"; exit 1; fi

.github/workflows/test_ble_uuid_parser.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ android {
4444
applicationId "com.navideck.universal_ble_example"
4545
// You can update the following values to match your application needs.
4646
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
47-
minSdkVersion 21
47+
minSdkVersion flutter.minSdkVersion
4848
targetSdkVersion 35
4949
versionCode flutterVersionCode.toInteger()
5050
versionName flutterVersionName

example/macos/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ EXTERNAL SOURCES:
2020
:path: Flutter/ephemeral/.symlinks/plugins/universal_ble/darwin
2121

2222
SPEC CHECKSUMS:
23-
device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f
23+
device_info_plus: b0fafc687fb901e2af612763340f1b0d4352f8e5
2424
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
25-
universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
25+
universal_ble: ff19787898040d721109c6324472e5dd4bc86adc
2626

2727
PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3
2828

lib/src/universal_ble.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class UniversalBle {
235235
}
236236

237237
/// Write a characteristic value.
238-
/// To write a characteristic value without response, set [withoutResponse] to [true].
238+
/// To write a characteristic value without response, set [withoutResponse] to `true`.
239239
static Future<void> write(
240240
String deviceId,
241241
String service,
@@ -364,7 +364,7 @@ class UniversalBle {
364364

365365
/// Get connected devices to the system (connected by any app).
366366
/// Use [withServices] to filter devices by services.
367-
/// On `Apple`, [withServices] is required to get any connected devices. If not passed, several [18XX] generic services will be set by default.
367+
/// On `Apple`, [withServices] is required to get any connected devices. If not passed, several 18XX generic services will be set by default.
368368
/// 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).
369369
/// Not supported on `Web`.
370370
static Future<List<BleDevice>> getSystemDevices({

0 commit comments

Comments
 (0)