| 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: |
| - stable |
| - master |
| os: |
| - ubuntu-latest |
| - windows-latest |
| steps: |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| - name: Cache Pub hosted dependencies |
| uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf |
| with: |
| path: "~/.pub-cache/hosted" |
| key: "pub-cache-hosted;${{ matrix.flutterSdk }};${{ matrix.os }}" |
| - name: Cache Pub sdk git dependency |
| uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf |
| with: |
| path: "~/.pub-cache/git/sdk-b0838eac58308fc4e6654ca99eda75b30649c08f/" |
| key: "pub-cache-git;${{ 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' }} |
| |
| - run: dart test |