Converge melos usage and CI scripts & add code coverage #1105
Workflow file for this run
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: Verify packages abilities | |
on: | |
push: | |
branches: | |
- main | |
- '6.0.0' | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
branches: | |
- main | |
- '6.0.0' | |
paths-ignore: | |
- "**.md" | |
# Ensure that new pushes/updates cancel running jobs | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -leo pipefail {0} | |
jobs: | |
workflows: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
sdk: [ min, stable, beta ] | |
env: | |
TEST_PRESET: all | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
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 | |
- name: Install proxy for tests | |
run: sudo apt-get update && sudo apt-get install -y squid | |
- run: dart pub get | |
- uses: bluefireteam/melos-action@v3 | |
with: | |
run-bootstrap: false | |
- name: Check satisfied packages | |
run: | | |
dart ./scripts/melos_packages.dart | |
echo $(cat .melos_packages) >> $GITHUB_ENV | |
- name: Melos Bootstrap | |
run: melos bootstrap | |
- name: '[Verify step] Format' | |
if: ${{ matrix.sdk == 'stable' }} | |
run: melos run format | |
- name: '[Verify step] Analyze packages' | |
if: ${{ matrix.sdk == 'stable' }} | |
run: melos run analyze | |
- name: '[Verify step] Publish dry-run' | |
if: ${{ matrix.sdk == 'stable' }} | |
run: melos run publish-dry-run | |
- name: '[Verify step] Test Dart packages [VM]' | |
run: melos run test:dart | |
- name: '[Verify step] Test Dart packages [Chrome]' | |
run: melos run test:web | |
env: | |
TEST_PLATFORM: chrome | |
- name: '[Verify step] Test Dart packages [Firefox]' | |
run: melos run test:web | |
env: | |
TEST_PLATFORM: firefox | |
- name: '[Verify step] Test Flutter packages' | |
run: melos run test:flutter | |
- name: '[Coverage] Format & print test coverage' | |
if: ${{ matrix.sdk == 'stable' }} | |
run: melos run coverage:show | |
- name: '[Coverage] Coverage Report' | |
uses: clearlyip/code-coverage-report-action@v4 | |
if: ${{ matrix.sdk == 'stable' && github.actor != 'dependabot[bot]'}} | |
with: | |
artifact_download_workflow_names: 'tests,coverage_base' | |
filename: 'coverage/cobertura.xml' |