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

Add GitHub Action dart-package-analyzer.yml #84

Merged
merged 18 commits into from
Oct 14, 2020

Conversation

cclauss
Copy link
Member

@cclauss cclauss commented Oct 14, 2020

@chimon2000 Your review, please?

Output: https://github.com/TheAlgorithms/Dart/runs/1253813888

Related to #86, #87, and #88

Welcome to Dart community

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Dart files are placed inside an existing directory.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@github-actions github-actions bot force-pushed the Add-GitHub-Action-test_flutter.yml branch from 178db0c to fbc9a59 Compare October 14, 2020 11:08
@cclauss
Copy link
Member Author

cclauss commented Oct 14, 2020

@axel-op Your review please.

@cclauss cclauss changed the title Add GitHub Action test_flutter.yml Add GitHub Action dart-package-analyzer.yml Oct 14, 2020
@axel-op
Copy link

axel-op commented Oct 14, 2020

@axel-op Your review please.

This repo is actually not a package (it does not respect the package layout conventions), that's why these checks are failing (there is no pubspec.yaml...)

@cclauss
Copy link
Member Author

cclauss commented Oct 14, 2020

Thanks @axel-op

I am not a Dart guy... What is the best way to create a GitHub Action that behaves like
https://github.com/TheAlgorithms/Dart/blob/master/.travis.yml

@cclauss cclauss marked this pull request as draft October 14, 2020 12:23
@axel-op
Copy link

axel-op commented Oct 14, 2020

@cclauss Try something like this:

name: Analyze

on: [push, pull_request]

jobs:
  analyze:
    runs-on: ubuntu-latest
    
    container: google/dart:2
    
    steps:
      - uses: actions/checkout@v2
      - name: Analyze
        run: dart analyze
      - name: Format
        run: |
          OUTPUT=$(dart format . -o none)
          if [ ! -z "$OUTPUT" ]; then exit 1; fi

@cclauss cclauss marked this pull request as ready for review October 14, 2020 14:08
Copy link
Member

@realDuYuanChao realDuYuanChao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cclauss cclauss merged commit babdeab into master Oct 14, 2020
@cclauss cclauss deleted the Add-GitHub-Action-test_flutter.yml branch October 14, 2020 14:15
@axel-op
Copy link

axel-op commented Oct 14, 2020

@cclauss You're welcome!

@cclauss
Copy link
Member Author

cclauss commented Oct 14, 2020

@axel-op I changed

OUTPUT=$(dart format . -o none)
if [ ! -z "$OUTPUT" ]; then exit 1; fi
# -->
dart format --set-exit-if-changed .

Merci beaucoup!

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

Successfully merging this pull request may close these issues.

4 participants