Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.buildobjects.process.StartupException: Could not startup process 'flutter analyze --no-fatal-warnings --no-fatal-infos'. #225

Open
iBelow opened this issue Jun 26, 2024 · 3 comments
Labels
waiting for feedback A feeback is necessary to investigate further

Comments

@iBelow
Copy link

iBelow commented Jun 26, 2024

git actions:

....
     - name: 🕵️ Analyze
        run: flutter analyze .
/// SUCCESS
      - name: 🧪 Run Tests
        run: flutter test --coverage --coverage-path=coverage/lcov.info --test-randomize-ordering-seed=random --concurrency=10
/// SUCCESS
      - name: 🪲 Run Sonar analyze
        uses: sonarsource/sonarqube-scan-action@master
        env:
          SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
          SONAR_PROJECT_KEY: ${{secrets.SONAR_KEY}}
          SONAR_HOST_URL: ${{secrets.SONAR_HOST_URL}}
/// ERROR org.buildobjects.process.StartupException: Could not startup process 'flutter analyze --no-fatal-warnings --no-fatal-infos'.

logic:
git action -> self-hosted runner

So, the runner raises a Docker container, inside which it tries to run the scanner, and, it fails with an error

@zippy1978
Copy link
Contributor

Hi @iBelow,

The error you get means that the "flutter" command what not found on system path.
In your "Run Sonar analyze" step, you use a different docker image (sonarsource/sonarqube-scan-action@master) where flutter is not installed.

You should install sonar-scanner on the flutter docker image, instead of using another one.

@zippy1978 zippy1978 added the waiting for feedback A feeback is necessary to investigate further label Jul 15, 2024
@iBelow
Copy link
Author

iBelow commented Jul 15, 2024

Yo, the issue is that the container is rockin’ the Flutter SDK image. You can peep that from the sweet results of the previous steps, like flutter analyze, flutter test, flutter coverage, and whatnot.

action script:

jobs:
  build:
    runs-on: self-hosted
    steps:
      - name: 📚 Git Checkout
        uses: actions/[email protected]

      - name: Get Flutter Version From FVM config
        id: get_flutter_version
        run: echo "::set-output name=version::$(cat .fvm/fvm_config.json | jq -r '.flutterSdkVersion')"

      - name: 🐦 Setup Flutter
        uses: subosito/[email protected]
        with:
          flutter-version: ${{ steps.get_flutter_version.outputs.version }}
          channel: stable
          cache: true
          cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}

      - name: 📦 Install Dependencies
        run: |
          flutter pub global activate very_good_cli
          flutter pub global activate intl_utils 2.8.4
          flutter pub global activate coverage

      - name: 🦄 Generate Code
        run: |
          flutter pub global run intl_utils:generate
          dart run build_runner build --delete-conflicting-outputs
  
      # - name: ✨ Check Formatting
      #   run: dart format --set-exit-if-changed .

      - name: 🕵️ Analyze
        run: flutter analyze .


      - name: 🧪 Run Tests
        run: flutter test --coverage --coverage-path=coverage/lcov.info --test-randomize-ordering-seed=random --concurrency=10

      - name: 🪲 Run Sonar analyze
        uses: sonarsource/sonarqube-scan-action@master
        env:
          SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
          SONAR_PROJECT_KEY: ${{secrets.SONAR_KEY}}
          SONAR_HOST_URL: ${{secrets.SONAR_HOST_URL}}
      - name: 📈 Upload Coverage
        uses: codecov/[email protected]
        with:
          # not needed for public repos
          token: ${{ secrets.CODECOV_TOKEN }}
          file: ./coverage/lcov.info
          flags: unittests
          name: codecov-umbrella
          slug: <SLUG>
          fail_ci_if_error: true

@zippy1978
Copy link
Contributor

Ok, strange...
Maybe install sonar-scanner manually instead of using sonarsource/sonar-scan-action task.
Check #118 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback A feeback is necessary to investigate further
Projects
None yet
Development

No branches or pull requests

2 participants