-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Comments
Hi @iBelow, The error you get means that the "flutter" command what not found on system path. You should install sonar-scanner on the flutter docker image, instead of using another one. |
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 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
|
Ok, strange... |
We fixed a similar issue at our organization updating the execution permissions of a JRE 17 file. The details are here: #214 (comment) |
actual:
what interesting:
So, the basic configuration looks like this: name: "Code Analysis"
on:
push:
branches: [develop/base]
pull_request:
branches: [develop/base]
workflow_dispatch:
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.7
flutter pub global activate coverage
- name: π¦ Generate Code
run: |
dart run build_runner build --delete-conflicting-outputs
- name: β¨ Generate Locales
run: |
flutter pub global run intl_utils:generate
- 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 Analysis
uses: sonarsource/[email protected]
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 The idea is that the current Flutter version is obtained from FVM, downloaded, cached, and used throughout all steps. Sonar, as I understand, works through a Docker container and has some issues. It might have been fixed, but in the version sonarsource/[email protected], the fix might not be included yet. |
Hi @iBelow ! Let me know if it is running on your side as well. |
@zippy1978 Thanks. I notice that the following errors in your GitHub Action run, should we ignore these errors? Moreover, in my run, these errors are not ignored and they are FATAL and terminates the GitHub action and fails the build. INFO: Running 'flutter analyze'... ERROR: Unable to find test file /home/runner/work/sonar-flutter-example/sonar-flutter-example/test/widget_test.dart |
Hi @gokul-ektar , |
But this GitHub Action runs in a Docker container environment, so Flutter should be inside it, ideally.
|
@iBelow, I will fix my example project |
@iBelow, name: Sonar Flutter Example
on:
push:
branches:
- main
jobs:
analyze:
runs-on: ubuntu-latest
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 get
- name: π§ͺ Run Tests
run: flutter test --machine --coverage > tests.output
- name: π΅ Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: πͺ² Run Sonar
run: |
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477.zip
unzip sonar-scanner-cli-6.1.0.4477.zip
./sonar-scanner-6.1.0.4477/bin/sonar-scanner \
-Dsonar.login=${{secrets.SONAR_TOKEN}} \
-Dsonar.host.url=${{secrets.SONAR_HOST_URL}}
|
great, i will try the suggested solution and let you know |
its works! thanx! |
git actions:
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
The text was updated successfully, but these errors were encountered: