Expose deviceProfile, displayName and forceConfirmation #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| # Cancel superseded runs for the same ref. | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Resolves the Flutter version from .fvmrc once and exposes it to the build | |
| # jobs, so the toolchain is driven by fvm — never hardcoded in the workflow. | |
| analyze-and-test: | |
| name: Format · Analyze · Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| outputs: | |
| flutter-version: ${{ steps.fvm.outputs.FLUTTER_VERSION }} | |
| flutter-channel: ${{ steps.fvm.outputs.FLUTTER_CHANNEL }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - id: fvm | |
| name: Read Flutter version from .fvmrc | |
| uses: kuhnroyal/flutter-fvm-config-action@v3 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ steps.fvm.outputs.FLUTTER_VERSION }} | |
| channel: ${{ steps.fvm.outputs.FLUTTER_CHANNEL }} | |
| cache: true | |
| - run: flutter pub get | |
| - name: Check formatting | |
| run: dart format --output=none --set-exit-if-changed lib test | |
| - name: Analyze | |
| run: flutter analyze | |
| - name: Test | |
| run: flutter test | |
| build-example: | |
| name: Build example APK | |
| needs: analyze-and-test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ needs.analyze-and-test.outputs.flutter-version }} | |
| channel: ${{ needs.analyze-and-test.outputs.flutter-channel }} | |
| cache: true | |
| - run: flutter pub get | |
| working-directory: example | |
| - run: flutter build apk --debug | |
| working-directory: example | |
| pana: | |
| name: pana score gate | |
| needs: analyze-and-test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ needs.analyze-and-test.outputs.flutter-version }} | |
| channel: ${{ needs.analyze-and-test.outputs.flutter-channel }} | |
| cache: true | |
| - run: flutter pub get | |
| - name: Run pana | |
| run: dart pub global activate pana && dart pub global run pana --no-warning --json . > pana.json | |
| - name: Enforce score threshold | |
| # Baseline gate. Raise toward the 150/160 target as the package matures. | |
| env: | |
| THRESHOLD: "120" | |
| run: | | |
| python3 - <<'PY' | |
| import json, os, sys | |
| data = json.load(open("pana.json")) | |
| granted = data["scores"]["grantedPoints"] | |
| maximum = data["scores"]["maxPoints"] | |
| threshold = int(os.environ["THRESHOLD"]) | |
| print(f"pana score: {granted}/{maximum} (threshold {threshold})") | |
| if granted < threshold: | |
| print(f"::error::pana score {granted} is below the threshold of {threshold}") | |
| sys.exit(1) | |
| PY |