Add pana job
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user