| name: package:dart_mcp_server |
| permissions: read-all |
| |
| on: |
| # Run CI on all PRs (against any branch) and on pushes to the main branch. |
| pull_request: |
| paths: |
| - ".github/workflows/dart_mcp_server.yaml" |
| - "pkgs/dart_mcp_server/**" |
| - "pkgs/dart_mcp/**" |
| push: |
| branches: [main] |
| paths: |
| - ".github/workflows/dart_mcp_server.yaml" |
| - "pkgs/dart_mcp_server/**" |
| - "pkgs/dart_mcp/**" |
| schedule: |
| - cron: "0 0 * * 0" # weekly |
| |
| defaults: |
| run: |
| working-directory: pkgs/dart_mcp_server |
| |
| jobs: |
| build: |
| runs-on: ${{ matrix.os }} |
| strategy: |
| fail-fast: false |
| matrix: |
| flutterSdk: |
| - beta |
| - master |
| os: |
| - ubuntu-latest |
| - windows-latest |
| steps: |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| - name: Cache Pub hosted dependencies |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 |
| with: |
| path: "~/.pub-cache/hosted" |
| key: "pub-cache-hosted;${{ matrix.flutterSdk }};${{ matrix.os }}" |
| # We need the flutter SDK in order to run the counter app for integration |
| # testing. |
| - uses: subosito/flutter-action@v2 |
| with: |
| channel: ${{ matrix.flutterSdk }} |
| cache: true |
| cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" |
| |
| - name: fetch counter app deps |
| working-directory: pkgs/dart_mcp_server/test_fixtures/counter_app |
| run: flutter pub get |
| |
| - run: dart pub get |
| - run: dart analyze --fatal-infos |
| - run: dart format --output=none --set-exit-if-changed . |
| if: ${{ matrix.flutterSdk == 'master' }} |
| |
| # If this fails, you need to run 'dart tool/update_readme.dart'. |
| - run: dart tool/update_readme.dart |
| - run: git diff --exit-code README.md || (echo 'README.md needs to be updated. Run "dart tool/update_readme.dart"' && false) |
| |
| - run: dart test |