Skip to content

patch-refactoring

patch-refactoring #1

Workflow file for this run

name: Test
on:
push:
branches: [main]
paths-ignore:
- "**/*.md"
- policies/*
- repo-assets/*
- configs/*
pull_request:
types: [review_requested]
paths-ignore:
- "**/*.md"
- policies/*
- repo-assets/*
- configs/*
jobs:
test:
strategy:
matrix:
dir:
- packages/screen_pal_core
- .
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ matrix.dir }}
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v3
- name: 🐦 Setup Flutter SDK v3.10.x
uses: subosito/flutter-action@v2
with:
flutter-version: 3.10.x
channel: stable
- name: 📦 Get dependencies
run: flutter pub get
- name: ⚙️ Setup environment
run: |
echo "${{secrets.DEV_ENV_FILE}}" > .env
dart run build_runner build -d
- name: ✨ Check Formatting
run: dart format lib --line-length 80 --set-exit-if-changed
- name: 🕵️ Analyze code
run: flutter analyze lib test
- name: 🧪 Run tests
id: test
run: |
if test -d "test"; then
flutter test --coverage
echo "RESULT=tested" >> "${GITHUB_OUTPUT}"
fi
- name: 📊 Check Code Coverage
if: ${{steps.test.outputs.RESULT == 'tested'}}
uses: VeryGoodOpenSource/very_good_coverage@v2
with:
path: ${{matrix.dir}}/coverage/lcov.info
exclude: "**/*.g.dart **/*.freezed.dart"
min_coverage: 80
- name: 📝 Upload coverage to codecov
if: ${{steps.test.outputs.RESULT == 'tested'}}
run: curl -s https://codecov.io/bash | bash