chore: added stackTrace
to [InStoreAppVersionCheckerResult] & chang…
#43
This file contains 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: Checkout | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "main" | |
- "master" | |
#- "dev" | |
#- "develop" | |
#- "feature/**" | |
#- "bugfix/**" | |
#- "hotfix/**" | |
#- "support/**" | |
paths: | |
- "lib/**.dart" | |
- "test/**.dart" | |
- "example/**.dart" | |
- .github/workflows/*.yml | |
- "pubspec.yaml" | |
- "example/pubspec.yaml" | |
pull_request: | |
branches: | |
- "main" | |
- "master" | |
- "dev" | |
- "develop" | |
- "feature/**" | |
- "bugfix/**" | |
- "hotfix/**" | |
- "support/**" | |
paths: | |
- "lib/**.dart" | |
- "test/**.dart" | |
- "example/**.dart" | |
- .github/workflows/*.yml | |
- "pubspec.yaml" | |
- "example/pubspec.yaml" | |
jobs: | |
checkout: | |
name: "Checkout" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./ | |
env: | |
pub-cache-name: pub | |
threshold: 50 | |
timeout-minutes: 15 | |
steps: | |
- name: 🚂 Get latest code | |
id: checkout | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
.github | |
pubspec.yaml | |
lib | |
test | |
analysis_options.yaml | |
CHANGELOG.md | |
- name: 👷 Install flutter | |
uses: subosito/flutter-action@v2 | |
id: install-flutter | |
with: | |
channel: 'stable' | |
# flutter-version: '3.22.3' | |
- name: 🔎 Check flutter version | |
id: check-flutter-version | |
run: flutter --version | |
- name: 📤 Restore Pub modules | |
id: cache-pub-restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
$PWD/.pub_cache/ | |
key: ${{ runner.os }}-pub-${{ env.pub-cache-name }}-${{ hashFiles('**/pubspec.yaml') }} | |
- name: 🗄️ Export Pub cache directory | |
id: export-pub-cache | |
timeout-minutes: 1 | |
run: | | |
export PUB_CACHE=$PWD/.pub_cache/ | |
export PATH="$PATH":"$HOME/.pub-cache/bin" | |
echo "${HOME}/.pub-cache/bin" >> $GITHUB_PATH | |
- name: 👷 Install Dependencies | |
id: install-dependencies | |
timeout-minutes: 2 | |
run: | | |
apt-get update && apt-get install -y lcov | |
flutter pub get --no-example | |
- name: 📥 Save Pub modules | |
id: cache-pub-save | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
$PWD/.pub_cache/ | |
key: ${{ runner.os }}-pub-${{ env.pub-cache-name }}-${{ hashFiles('**/pubspec.yaml') }} | |
- name: 🔎 Check format | |
id: check-format | |
timeout-minutes: 1 | |
run: dart format --set-exit-if-changed -l 80 -o none lib/ | |
- name: 📈 Check analyzer | |
id: check-analyzer | |
timeout-minutes: 1 | |
run: dart analyze --fatal-infos --fatal-warnings lib/ | |
- name: 🧪 Run tests | |
id: run-tests | |
timeout-minutes: 2 | |
run: | | |
flutter test -r github -j 6 --coverage test/flutter_in_store_app_version_checker_test.dart | |
# - name: 🔍 Check coverage | |
# id: check-coverage | |
# timeout-minutes: 2 | |
# run: | | |
# mv coverage/lcov.info coverage/lcov.base.info | |
# lcov --remove coverage/lcov.base.info '*.g.dart' -o coverage/lcov.info | |
# lcov --list coverage/lcov.info | |
# THRESHOLD=${{ env.threshold }} | |
# COVERAGE=$(lcov --summary coverage/lcov.info | grep -i 'lines\|Total:' | tail -n 1 | awk '{print $2}' | sed 's/%//') | |
# echo "Coverage is $COVERAGE%" | |
# echo $COVERAGE | awk '{if ($1 < 50) exit 1}' | |
- name: 📥 Upload coverage to Codecov | |
id: upload-coverage-to-codecov | |
timeout-minutes: 1 | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage/lcov.info | |
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos |