-
Notifications
You must be signed in to change notification settings - Fork 1
chore(repo): initial package and workflow setup #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ef345f8
chore: initial package and workflow setup
renefloor 9e6864e
remove analysis options in package
renefloor 180f4f9
update flutter and dart dependency
renefloor c5e5f05
decrease pana for now
renefloor 3f907cb
Update .github/pull_request_template.md
renefloor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Default owner for everything in the repo | ||
| * @GetStream/flutter-developers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: Package Analysis | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: "Install Tools" | ||
| shell: bash | ||
| run: flutter pub global activate melos | ||
|
|
||
| - name: "Bootstrap Workspace" | ||
| shell: bash | ||
| run: melos bootstrap --verbose | ||
| env: | ||
| MELOS_PACKAGES: stream_**,example | ||
|
|
||
| # Only analyze lib/; non-client code doesn't need to work on | ||
| # all supported legacy version. | ||
| - name: "Stream Feeds Analyze" | ||
| shell: bash | ||
| run: cd packages/stream_feeds/lib && dart analyze --fatal-warnings . && cd .. && flutter test --exclude-tags golden |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: Pana Workflow | ||
|
|
||
| inputs: | ||
| min_score: | ||
| required: false | ||
| type: number | ||
| default: 120 | ||
| pana_version: | ||
| required: false | ||
| type: string | ||
| runs_on: | ||
| required: false | ||
| type: string | ||
| default: "ubuntu-latest" | ||
| working_directory: | ||
| required: false | ||
| type: string | ||
| default: "." | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Install Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| cache: true | ||
| channel: stable | ||
| flutter-version: "3.x" | ||
| cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} | ||
|
|
||
| - name: Install Pana | ||
| working-directory: ${{ inputs.working_directory }} | ||
| shell: bash | ||
| run: flutter pub global activate pana ${{inputs.pana_version}} | ||
|
|
||
| - name: Verify Pana Score | ||
| working-directory: ${{ inputs.working_directory }} | ||
| shell: bash | ||
| run: | | ||
| PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p") | ||
| echo "Score: $PANA_SCORE" | ||
| IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0]; | ||
| if (( $SCORE < ${{inputs.min_score}} )); then echo "The minimum score of ${{inputs.min_score}} was not met!"; exit 1; fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Submit a pull request | ||
| <!--Internal tickets have to be added by Stream devs--> | ||
| Closes FLU- | ||
| <!--Optional to add github issue which is solved by this PR--> | ||
| Closes # | ||
|
|
||
| ## CLA | ||
|
|
||
| - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required). | ||
| - [ ] The code changes follow best practices | ||
| - [ ] Code changes are tested (add some information if not applicable) | ||
|
|
||
| ## Description of the pull request | ||
| <!-- | ||
| Describe how these code changes fix the issue or how the feature works. | ||
| Also try to give instructions how this can be tested. | ||
| --> | ||
|
|
||
| ## Screenshots / Videos | ||
|
|
||
| <!-- Consider to add screenshots and/or videos to show the effect of the change --> | ||
|
|
||
| | Before | After | | ||
| | --- | --- | | ||
| | img | img | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: beta_version_analyze | ||
|
|
||
| on: | ||
| schedule: | ||
| # Runs "At 03:00 every monday" | ||
| - cron: '0 3 * * 1' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| # Does a sanity check on packages for the next beta version so we are not surprised by any breaking changes. | ||
| analyze_beta_versions: | ||
| timeout-minutes: 15 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: "Git Checkout" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: "Install Flutter" | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| channel: beta | ||
| cache: true | ||
| cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} | ||
|
|
||
| - name: 📊 Analyze and test packages | ||
| uses: ./.github/actions/package_analysis | ||
|
|
||
| slack: | ||
| name: Slack Report | ||
| runs-on: ubuntu-latest | ||
| needs: [analyze_beta_versions] | ||
| if: failure() && github.event_name == 'schedule' | ||
| steps: | ||
| - uses: 8398a7/action-slack@v3 | ||
| with: | ||
| status: failure | ||
| text: "<@U08BMRSM8G5>: The beta build for Flutter Feeds failed. Please check the logs." | ||
| job_name: "${{ github.workflow }}: ${{ github.job }}" | ||
| fields: repo,commit,author,workflow | ||
| env: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_NIGHTLY_CHECKS }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: legacy_version_analyze | ||
|
|
||
| env: | ||
| # Note: The versions below should be manually updated after a new stable | ||
| # version comes out. | ||
| flutter_version: "3.27.4" | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - develop | ||
| paths: | ||
| - "packages/**" | ||
| - ".github/workflows/legacy_version_analyze.yml" | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - develop | ||
| paths: | ||
| - "packages/**" | ||
| - ".github/workflows/legacy_version_analyze.yml" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| # Does a sanity check that packages at least pass analysis on the N-1 | ||
| # versions of Flutter stable if the package claims to support that version. | ||
| # This is to minimize accidentally making changes that break old versions | ||
| # (which we don't commit to supporting, but don't want to actively break) | ||
| # without updating the constraints. | ||
| analyze_legacy_version: | ||
| timeout-minutes: 15 | ||
| if: github.event.pull_request.draft == false | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: "Git Checkout" | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: "Install Flutter" | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| cache: true | ||
| flutter-version: ${{ env.flutter_version }} | ||
|
|
||
| - name: 📊 Analyze and test packages | ||
| uses: ./.github/actions/package_analysis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||
| name: pana | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| branches: | ||||||
| - main | ||||||
| push: | ||||||
| branches: | ||||||
| - main | ||||||
|
|
||||||
| concurrency: | ||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||
| cancel-in-progress: true | ||||||
|
|
||||||
| jobs: | ||||||
| stream_feeds: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: 📚 Git Checkout | ||||||
| uses: actions/checkout@v4 | ||||||
| - name: 📊 Verify Pana Score | ||||||
| uses: ./.github/actions/pana | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once removed, we can use our core action here
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| with: | ||||||
| working_directory: packages/stream_feeds | ||||||
| min_score: 130 # Missing 10 points for no example and 10 points for license | ||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: 'PR is Conventional and Semantic' | ||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - opened | ||
| - edited | ||
| - synchronize | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| conventional_pr_title: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: amannn/action-semantic-pull-request@v5.5.3 | ||
| with: | ||
| scopes: | | ||
| llc | ||
| repo | ||
| requireScope: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| semantic_changelog_update: | ||
| needs: conventional_pr_title # Trigger after the [conventional_pr_title] completes | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: GetStream/verify-semantic-changelog-update@main | ||
| with: | ||
| scopes: | | ||
| { | ||
| "llc": "packages/stream_feeds" | ||
| } | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Fast fail the script on failures. | ||
| set -e | ||
|
|
||
| flutter pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' -r '\.freezed\.dart$' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: stream_feeds_flutter_workflow | ||
|
|
||
| env: | ||
| FLUTTER_CHANNEL: stable | ||
| ENV_PROPERTIES: ${{ secrets.ENV_PROPERTIES }} | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - ready_for_review | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| analyze: | ||
| timeout-minutes: 15 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Git Checkout | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| cache: true | ||
| cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} | ||
| channel: ${{ env.FLUTTER_CHANNEL }} | ||
|
|
||
| - name: Install Tools | ||
| run: | | ||
| flutter pub global activate melos | ||
| flutter pub global activate remove_from_coverage | ||
|
|
||
| - name: Bootstrap Workspace | ||
| run: melos bootstrap --verbose | ||
|
|
||
| - name: Dart Analyze | ||
| run: | | ||
| melos run analyze | ||
|
|
||
| - name: Check formatting | ||
| run: | | ||
| melos run format:verify | ||
|
|
||
| ## Test and coverage reporting | ||
| - name: "Flutter Test" | ||
| run: melos run test:all | ||
| - name: "Collect Coverage" | ||
| run: melos run coverage:ignore-file --no-select | ||
| - name: "Upload Coverage" | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{secrets.CODECOV_TOKEN}} | ||
| files: packages/*/coverage/lcov.info |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove this action and use the one we created in core. So any fixes can happen at one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah good idea, but let's take that as a separate task.