Skip to content

chore(deps): bump fl_chart from 1.1.1 to 1.2.0 #121

chore(deps): bump fl_chart from 1.1.1 to 1.2.0

chore(deps): bump fl_chart from 1.1.1 to 1.2.0 #121

name: Frontend Tests
permissions:
contents: read
on:
pull_request:
branches: [main]
paths:
- 'lib/**'
- 'test/**'
- 'pubspec.yaml'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.5'
channel: 'stable'
cache: true
- name: Install dependencies
run: flutter pub get
- name: Analyze code
run: flutter analyze --no-fatal-infos --no-fatal-warnings
- name: Run tests with coverage
run: flutter test --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage/lcov.info
flags: frontend
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Check coverage threshold
run: |
# Check if coverage file exists
if [ ! -f coverage/lcov.info ]; then
echo "::error::coverage/lcov.info not found. Tests may have failed."
exit 1
fi
# Install lcov for coverage parsing
sudo apt-get update -qq
sudo apt-get install -y lcov
# Parse coverage with error handling
if ! COVERAGE=$(lcov --summary coverage/lcov.info 2>&1 | grep "lines" | awk '{print $2}' | sed 's/%//'); then
echo "::error::Failed to parse coverage data"
exit 1
fi
# Validate coverage is a number
if ! [[ "$COVERAGE" =~ ^[0-9]+\.?[0-9]*$ ]]; then
echo "::error::Invalid coverage value: $COVERAGE"
exit 1
fi
echo "Coverage: ${COVERAGE}%"
# Check if coverage meets minimum threshold (50%) using awk
if awk "BEGIN {exit !($COVERAGE < 50)}"; then
echo "::warning::Coverage ${COVERAGE}% is below target threshold of 50%"
else
echo "::notice::Frontend test coverage: ${COVERAGE}% (target: 50-60%)"
fi