Skip to content

⚡️ Improve melos and workflow setup #779

⚡️ Improve melos and workflow setup

⚡️ Improve melos and workflow setup #779

Workflow file for this run

name: Format & Analyze & Dry-run & Test
on:
push:
branches:
- main
- '6.0.0'
paths-ignore:
- "**.md"
pull_request:
branches:
- main
- '6.0.0'
paths-ignore:
- "**.md"
jobs:
workflows:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [ min, stable, beta ]
steps:
- uses: actions/checkout@v3
- uses: subosito/[email protected]
with:
cache: true
flutter-version: ${{ matrix.sdk == 'min' && '2.8.0' || '' }}
channel: ${{ matrix.sdk == 'min' && '' || matrix.channel }}
- run: |
chmod +x ./scripts/prepare_pinning_certs.sh
./scripts/prepare_pinning_certs.sh
shell: bash
- name: Install proxy for tests
run: sudo apt-get install -y squid
- run: dart pub get
- name: Ignore unsatisfied packages
run: export MELOS_IGNORE_PACKAGES=$(dart ./scripts/melos_packages.dart false)
- uses: bluefireteam/melos-action@v2
with:
run-bootstrap: false
- name: Patching files for Flutter ${{ matrix.sdk }}
run: dart $MELOS_ROOT_PATH/scripts/files_patch.dart
- name: Bootstrap
run: melos pre-bootstrap
- name: Format
run: melos exec $(eval echo $MELOS_IGNORE_PACKAGES) -- "dart format --set-exit-if-changed ."
- name: Analyze Dart packages
run: melos exec $(eval echo $MELOS_IGNORE_PACKAGES) --no-flutter -- "dart analyze --fatal-infos"
- name: Analyze Flutter packages
run: melos exec $(eval echo $MELOS_IGNORE_PACKAGES) --flutter -- "flutter analyze --fatal-infos"
- name: Publish dry-run
run: melos exec $(eval echo $MELOS_IGNORE_PACKAGES) --ignore="*example*" -- "dart pub publish --dry-run"
- name: Test Dart packages
run: melos exec $(eval echo $MELOS_IGNORE_PACKAGES) --ignore="*example*" --no-flutter -- "dart test --chain-stack-traces --platform=vm,chrome,firefox"
- name: Test Flutter packages
run: melos exec $(eval echo $MELOS_IGNORE_PACKAGES) --ignore="*example*" --flutter -- "flutter test"