diff --git a/.github/workflows/all_plugins.yaml b/.github/workflows/all_plugins.yaml index ebf42c2afa..36b2d396e1 100644 --- a/.github/workflows/all_plugins.yaml +++ b/.github/workflows/all_plugins.yaml @@ -1,8 +1,5 @@ name: all_plugins -env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' - on: pull_request: push: @@ -16,110 +13,127 @@ jobs: timeout-minutes: 15 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - name: 'Git Checkout' + uses: actions/checkout@v2 with: fetch-depth: 0 - name: 'Install Flutter' - run: ./.github/workflows/scripts/install-flutter.sh beta + uses: subosito/flutter-action@refs/pull/79/head - name: 'Install Tools' run: | - ./.github/workflows/scripts/install-tools.sh + flutter pub global activate melos flutter pub global activate tuneup - name: 'Bootstrap Workspace' run: melos bootstrap - name: 'Dart Analyze' run: | - melos exec -c 3 -- \ - tuneup check + melos run analyze - name: 'Pub Check' run: | - melos exec -c 1 --no-private --ignore="*example*" -- \ - pub publish --dry-run + melos run lint:pub + format: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v1 + - name: 'Git Checkout' + uses: actions/checkout@v2 with: fetch-depth: 0 - name: 'Install Flutter' - run: ./.github/workflows/scripts/install-flutter.sh beta + uses: subosito/flutter-action@refs/pull/79/head - name: 'Install Tools' run: | - ./.github/workflows/scripts/install-tools.sh - curl -sL https://github.com/google/google-java-format/releases/download/google-java-format-1.3/google-java-format-1.3-all-deps.jar -o $HOME/google-java-format.jar + flutter pub global activate melos + flutter pub global activate flutter_plugin_tools - name: 'Bootstrap Workspace' run: melos bootstrap - - name: 'Dart' - run: | - melos exec -c 1 -- \ - flutter format . - ./.github/workflows/scripts/validate-formatting.sh - - name: 'Objective-C' - if: ${{ success() || failure() }} + - name: 'Melos Format' + run: melos run format + - name: 'Validate Formatting' run: | - melos exec -c 4 --ignore="*platform_interface*" --ignore="*web*" -- \ - find . -maxdepth 3 -name "*.h" -o -name "*.m" -print0 \| xargs -0 clang-format -i --style=Google --verbose - ./.github/workflows/scripts/validate-formatting.sh - - name: 'Java' - if: ${{ success() || failure() }} - run: | - melos exec -c 4 --ignore="*platform_interface*" --ignore="*web*" -- \ - find . -maxdepth 12 -name "*.java" -print0 \| xargs -0 java -jar $HOME/google-java-format.jar --replace ./.github/workflows/scripts/validate-formatting.sh + build_examples_dart: timeout-minutes: 15 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - name: 'Git Checkout' + uses: actions/checkout@v2 with: fetch-depth: 0 - name: 'Install Flutter' - run: ./.github/workflows/scripts/install-flutter.sh beta + uses: subosito/flutter-action@refs/pull/79/head - name: 'Install Tools' - run: ./.github/workflows/scripts/install-tools.sh + run: flutter pub global activate melos - name: 'Bootstrap Workspace' run: melos bootstrap - name: 'Build Example Snapshots' run: | - melos exec -c 1 --scope="*example*" -- \ - flutter build bundle + melos run build:examples:bundle + test: - runs-on: ubuntu-latest + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + continue-on-error: true timeout-minutes: 15 steps: - - uses: actions/checkout@v1 + - name: 'Git Checkout' + uses: actions/checkout@v2 with: fetch-depth: 0 - name: 'Install Flutter' - run: ./.github/workflows/scripts/install-flutter.sh beta + uses: subosito/flutter-action@refs/pull/79/head - name: 'Install Tools' - run: ./.github/workflows/scripts/install-tools.sh + run: flutter pub global activate melos - name: 'Bootstrap Workspace' run: melos bootstrap - name: 'Flutter Test' run: | - melos exec -c 3 --dir-exists=test --ignore="*example*" --ignore="*web*" -- \ - flutter test + melos run test + if: matrix.os != 'ubuntu-latest' + - name: 'Collect Coverage' + run: | + melos run coverage + if: matrix.os == 'ubuntu-latest' + - name: Upload Coverage + uses: codecov/codecov-action@v1 + with: + token: ${{secrets.CODECOV_TOKEN}} + files: packages/*/coverage/lcov.info + if: matrix.os == 'ubuntu-latest' + integration_tests: - runs-on: ubuntu-latest + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [ubuntu-latest] + continue-on-error: true timeout-minutes: 15 steps: - - uses: actions/checkout@v1 + - name: 'Git Checkout' + uses: actions/checkout@v2 with: fetch-depth: 0 - name: 'Install Flutter' - run: | - ./.github/workflows/scripts/install-flutter.sh dev --force + uses: subosito/flutter-action@refs/pull/79/head + with: + channel: dev - name: 'Install Tools' run: | - ./.github/workflows/scripts/install-tools.sh + flutter pub global activate melos flutter config --enable-linux-desktop + - name: 'Setup Linux' + run: | sudo apt update sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb sudo apt install -y network-manager upower + if: matrix.os == 'ubuntu-latest' - name: 'Bootstrap Workspace' run: melos bootstrap - name: 'Flutter Integration Test' run: | melos run test:e2e:linux + if: matrix.os == 'ubuntu-latest' diff --git a/.github/workflows/scripts/install-flutter.sh b/.github/workflows/scripts/install-flutter.sh deleted file mode 100755 index 80e4395d5d..0000000000 --- a/.github/workflows/scripts/install-flutter.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -BRANCH=$1 - -if [ "$BRANCH" == "dev" ] && [ "$2" != "--force" ] -then - # TODO Flutter dev branch is currently broken so we're unable to test MacOS. - echo "TODO: Skipping macOS testing due to Flutter dev branch issue. Switching branch to stable." - BRANCH=stable -fi - -git clone https://github.com/flutter/flutter.git --depth 1 -b $BRANCH _flutter -echo "::add-path::$GITHUB_WORKSPACE/_flutter/bin" diff --git a/.github/workflows/scripts/install-tools.sh b/.github/workflows/scripts/install-tools.sh deleted file mode 100755 index 087cfecb52..0000000000 --- a/.github/workflows/scripts/install-tools.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -flutter pub global activate melos -echo "::add-path::$HOME/.pub-cache/bin" -echo "::add-path::$GITHUB_WORKSPACE/_flutter/.pub-cache/bin" -echo "::add-path::$GITHUB_WORKSPACE/_flutter/bin/cache/dart-sdk/bin" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 33bf24013d..3d578ae389 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,6 @@ build/ /.fvm .melos_tool/ -**/*.env \ No newline at end of file +**/*.env + +lcov.info diff --git a/README.md b/README.md index 4b9b328508..3b8c61ac4d 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ all_plugins GitHub Workflow Status + + all_plugins Coverage + Follow on Twitter diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..69cb76019a --- /dev/null +++ b/codecov.yml @@ -0,0 +1 @@ +comment: false diff --git a/melos.yaml b/melos.yaml index 476cf80bc9..7650e128fe 100644 --- a/melos.yaml +++ b/melos.yaml @@ -14,19 +14,24 @@ scripts: # Analyze the project for Dart analysis issues. # - Requires `pub global activate tuneup`. analyze: > - melos exec -c 1 --fail-fast -- \ - pub global run tuneup check + melos exec -c 3 -- \ + tuneup check # Formats the code of all packages (Java, Objective-C, and Dart). # - Requires `flutter_plugin_tools` (`pub global activate flutter_plugin_tools`). # - Requires `git`. # - Requires `clang-format` (can be installed via Brew on MacOS). - format: pub global run flutter_plugin_tools format + format: flutter pub global run flutter_plugin_tools format # Build iOS plugin example apps. build:examples:ios: > melos exec -c 1 --scope="*example*" --fail-fast -- \ flutter build ios --no-codesign + # Build example bundles. + build:examples:bundle: > + melos exec -c 1 --scope="*example*" --fail-fast -- \ + flutter build bundle + # Build Android plugin example apps. build:examples:android: > melos exec -c 1 --scope="*example*" --fail-fast -- \ @@ -47,6 +52,11 @@ scripts: melos exec -c 1 --fail-fast --dir-exists=test --scope="*web*" -- \ flutter test --platform=chrome + # Coverage + coverage: > + melos exec -c 1 --fail-fast --dir-exists=test --ignore="*example*" --ignore="*web*" -- \ + flutter test --coverage + # Run all test driver e2e tests in the example apps, use this for mobile. # Will target Android/iOS depending on what emulator/simulator you have running. test:e2e: >