Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default owner for everything in the repo
* @GetStream/flutter-developers
20 changes: 20 additions & 0 deletions .github/actions/package_analysis/action.yml
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
43 changes: 43 additions & 0 deletions .github/actions/pana/action.yml
Copy link
Member

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.

Copy link
Collaborator Author

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.

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
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
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 |
43 changes: 43 additions & 0 deletions .github/workflows/beta_version_analyze.yml
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 }}
51 changes: 51 additions & 0 deletions .github/workflows/legacy_version_analyze.yml
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
25 changes: 25 additions & 0 deletions .github/workflows/pana.yml
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
Copy link
Member

Choose a reason for hiding this comment

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

Once removed, we can use our core action here

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
uses: ./.github/actions/pana
uses: GetStream/stream-core-flutter/.github/actions/pana

with:
working_directory: packages/stream_feeds
min_score: 130 # Missing 10 points for no example and 10 points for license
39 changes: 39 additions & 0 deletions .github/workflows/pr_title.yml
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 }}
6 changes: 6 additions & 0 deletions .github/workflows/scripts/remove-from-coverage.sh
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$'
64 changes: 64 additions & 0 deletions .github/workflows/stream_feeds_flutter_workflow.yml
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
Loading