Skip to content

Merge pull request #33 from ahmadexe/deployments/v4.1.0-and-v1.1.0 #59

Merge pull request #33 from ahmadexe/deployments/v4.1.0-and-v1.1.0

Merge pull request #33 from ahmadexe/deployments/v4.1.0-and-v1.1.0 #59

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze-and-test:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v7
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.44.3
cache: true
- name: Activate Melos
run: dart pub global activate melos
- name: Bootstrap workspace
run: dart pub get
- name: Verify formatting (all packages)
run: dart pub global run melos run format-check
- name: Analyze (all packages)
run: dart pub global run melos run analyze
- name: Run tests with coverage (all packages)
run: dart pub global run melos run test:coverage
- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov
- name: Merge + enforce coverage floor
run: |
FILES=$(find packages -path '*/coverage/lcov.info')
echo "Coverage files: $FILES"
ARGS=""
for f in $FILES; do ARGS="$ARGS -a $f"; done
lcov $ARGS -o merged.lcov.info
PCT=$(lcov --summary merged.lcov.info 2>&1 \
| grep -iE 'lines' | grep -oE '[0-9]+\.[0-9]+' | head -1)
if [ -z "$PCT" ]; then
echo "::warning::Could not parse coverage — skipping floor check"; exit 0; fi
echo "Line coverage: ${PCT}% (min 50%)"
awk -v p="$PCT" -v m="50" 'BEGIN { exit (p+0 >= m+0) ? 0 : 1 }'
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage
path: merged.lcov.info
if-no-files-found: warn
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v7
with:
files: merged.lcov.info
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}