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

Using custom Flutter channel (beta, master, dev) #5

Closed
Dogacel opened this issue Apr 27, 2020 · 6 comments
Closed

Using custom Flutter channel (beta, master, dev) #5

Dogacel opened this issue Apr 27, 2020 · 6 comments

Comments

@Dogacel
Copy link

Dogacel commented Apr 27, 2020

I am trying to use dart-package-analyzer in github actions with a beta version of flutter but I am getting the following issue:

Issues

General

  • Fix dependencies in pubspec.yaml
    Running flutter pub upgrade failed with the following output:
    • ERR: The current Flutter SDK version is 1.12.13+hotfix.9.
    • Because boo_app requires Flutter SDK version ^1.17.0, version solving failed.

and I also get

  • No valid SDK
    20.0 points
    The analysis could not detect a valid SDK that can use this package.

and this is my workflow file

jobs:
  package-analysis:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: axel-op/dart-package-analyzer@stable
        id: analysis # set an id for the current step
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }}

      # You can then use this id to retrieve the outputs in the next steps.
      # The following step shows how to exit the workflow with an error if a score is below 100:
      - name: Check scores
        # NB: "analysis" is the id set above. Replace it with the one you used if different.
        run: |
          MAINTENANCE_SCORE=${{ steps.analysis.outputs.maintenance }}
          HEALTH_SCORE=${{ steps.analysis.outputs.health }}
          if (( $(echo "$MAINTENANCE_SCORE < 50" | bc) )) || (( $(echo "$HEALTH_SCORE < 50" | bc) ))
          then
            echo "Scores are less than 50"
            exit 1
          fi

This is not much different from the default version. Can you help me with this?

@axel-op
Copy link
Owner

axel-op commented Apr 27, 2020

Hi,

You're right, my action doesn't handle other branches than stable.

To do what you want to do, you need to set up your own container with Flutter, and to copy this repository in it. Try this:

  package-analysis:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Set path
        run: |
          echo "::add-path::$HOME/flutter/bin"
          echo "::add-path::$HOME/flutter/bin/cache/dart-sdk/bin"
          echo "::add-path::$HOME/.pub-cache/bin"

      - name: Install Flutter and Pana
        env:
          # The Flutter channel you want to use
          CHANNEL: beta
        run: |
          sudo apt-get update -y
          sudo apt-get install -y --no-install-recommends unzip
          git clone https://github.com/flutter/flutter.git -b $CHANNEL $HOME/flutter
          flutter doctor
          flutter pub global activate pana

      - name: Run Dart Package Analyzer
        env:
          INPUT_GITHUBTOKEN: ${{ secrets.GITHUB_TOKEN }}
          INPUT_MINANNOTATIONLEVEL: info
        run: |
          git clone https://github.com/axel-op/dart-package-analyzer.git -b stable $HOME/dart-package-analyzer
          cd $HOME/dart-package-analyzer/app
          flutter pub get
          dart bin/main.dart

      - name: Check scores
        # ...

@axel-op axel-op pinned this issue Apr 27, 2020
@axel-op axel-op changed the title Using with a beta flutter channel Using custom Flutter channel (beta, master, dev) Apr 27, 2020
@Dogacel
Copy link
Author

Dogacel commented May 1, 2020

I would be happy if you can add this as a feature to your package.

@axel-op
Copy link
Owner

axel-op commented May 1, 2020

Well, did you try what I suggested? Just do a copy/paste.

@creativecreatorormaybenot

Does this even make sense for package analysis? I mean Pub only tests on stable 😄

@axel-op
Copy link
Owner

axel-op commented Jun 10, 2020

@creativecreatorormaybenot Yeah exactly!

@axel-op
Copy link
Owner

axel-op commented Jun 10, 2020

Btw @Dogacel since I have no answer from you I'm gonna close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants