Skip to content

R2.1.0

R2.1.0 #165

Workflow file for this run

name: Test
on:
push:
branches:
- main
- 'r[0-9]+.[0-9]+.*'
pull_request:
branches:
- main
- 'r[0-9]+.[0-9]+.*'
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
name: Analyze & Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Flutter
id: flutter-action
uses: subosito/flutter-action@v2
with:
flutter-version-file: './workout-logger/pubspec.yaml'
channel: 'stable'
cache: true
# Custom pub cache key hashing pubspec.lock to invalidate cache on dependency changes
pub-cache-key: "flutter-pub-:os:-:channel:-:version:-:arch:-${{ hashFiles('workout-logger/pubspec.lock') }}"
- name: Install dependencies
if: steps.flutter-action.outputs.CACHE-HIT != 'true'
working-directory: ./workout-logger
run: flutter pub get
- name: Analyze
working-directory: ./workout-logger
run: |
set -o pipefail
# Only fail on errors, ignore warnings and info messages
flutter analyze --no-fatal-infos --no-fatal-warnings | tee analyze_output.txt
# Extract and display the summary of issues
SUMMARY=$(tail -n 1 analyze_output.txt)
echo "Analysis Summary: $SUMMARY"
echo "### Analysis Summary" >> $GITHUB_STEP_SUMMARY
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
- name: Run tests
working-directory: ./workout-logger
run: flutter test --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: workout-logger/coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
slug: Devasy/RepForge