Skip to content

Commit

Permalink
merge new changes, resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlinaStepanova committed Nov 4, 2024
2 parents 883e5f0 + 1166df3 commit 91da00c
Show file tree
Hide file tree
Showing 276 changed files with 13,791 additions and 5,175 deletions.
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.22.3"
}
6 changes: 5 additions & 1 deletion .github/actions/setup_flutter/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ inputs:
description: "The working directory where the Flutter project is located."
required: false
default: "."
version:
description: "The version of Flutter to install."
required: false
default: "3.x"

runs:
using: "composite"
Expand All @@ -14,7 +18,7 @@ runs:
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.x
flutter-version: ${{ inputs.version }}
cache: true

- name: Flutter version
Expand Down
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Related issues (optional)

None.

## Description

Blah blah blah.

## Summary (check all that apply)

- [ ] Modified / added code
- [ ] Modified / added tests
- [ ] Modified / added examples
- [ ] Modified / added others (pubspec.yaml, workflows, etc...)
- [ ] Updated README
- [ ] Contains breaking changes
- [ ] Created / updated migration guide
- [ ] Incremented version number
- [ ] Updated CHANGELOG
63 changes: 43 additions & 20 deletions .github/workflows/code_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,78 +9,101 @@ env:
PATTERN_CHECKER: ${{github.workspace}}/scripts/pattern_checker.sh

jobs:
# Change detection
changes:
setup:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
dart-files: ${{ steps.filter.outputs.dart-files }}
flutter-file-changed: ${{ steps.filter.outputs.flutter-file-changed }}
flutter-lower-bound: ${{ steps.flutter-version-constraint.outputs.lower-bound }}
flutter-upper-bound: ${{ steps.flutter-version-constraint.outputs.upper-bound }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3

- name: Filter changed files
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
dart-files:
flutter-file-changed:
- '**.dart'
- 'pubspec.yaml'
- 'pubspec.lock'
- name: Get Flutter SDK version constraint
id: flutter-version-constraint
# Extract the lower bound from pubspec.yaml and the upper bound from .fvmrc
run: |
sdk_constraint=$(cat pubspec.yaml | yq .environment.flutter)
lower_bound=$(echo "$sdk_constraint" | grep -oP '(?<=\>=)[0-9]+\.[0-9]+\.[0-9]+' | head -1)
upper_bound=$(cat .fvmrc | jq -r .flutter)
echo "lower-bound=$lower_bound" >> "$GITHUB_OUTPUT"
echo "upper-bound=$upper_bound" >> "$GITHUB_OUTPUT"
- name: Print output values
run: |
echo "flutter-file-changed=${{ steps.filter.outputs.flutter-file-changed }}"
echo "flutter-lower-bound=${{ steps.flutter-version-constraint.outputs.lower-bound }}"
echo "flutter-upper-bound=${{ steps.flutter-version-constraint.outputs.upper-bound }}"
# Static code analysis
analysis:
needs: changes
if: ${{ needs.changes.outputs.dart-files == 'true' }}
needs: setup
if: ${{ needs.setup.outputs.flutter-file-changed == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
target: [package, cookbook]
flutter-version:
- ${{ needs.setup.outputs.flutter-lower-bound }}
- ${{ needs.setup.outputs.flutter-upper-bound }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Flutter
uses: ./.github/actions/setup_flutter
with:
target: ${{ matrix.target }}
version: ${{ matrix.flutter-version }}

- name: Format
run: dart format . -o none --set-exit-if-changed
working-directory: ${{ matrix.target }}

- name: Analyze
run: dart analyze
working-directory: ${{ matrix.target }}

- name: Disallowed patterns check
run: bash ${{ env.PATTERN_CHECKER }} "*.dart" "--" "debugPrint"
working-directory: ${{ matrix.target }}

# Unit testing
testing:
needs: changes
if: ${{ needs.changes.outputs.dart-files == 'true' }}
needs: setup
if: ${{ needs.setup.outputs.flutter-file-changed == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
checks: write
strategy:
matrix:
flutter-version:
- ${{ needs.setup.outputs.flutter-lower-bound }}
- ${{ needs.setup.outputs.flutter-upper-bound }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Flutter
uses: ./.github/actions/setup_flutter
with:
target: package
version: ${{ matrix.flutter-version }}

- name: Run unit tests
run: flutter test --file-reporter="json:${{ env.FLUTTER_TEST_REPORT }}"
working-directory: package

- name: Write test report
uses: dorny/test-reporter@v1
if: success() || failure()
# PRs from forks have no write permissions.
if: github.event.pull_request.head.repo.fork == false && (success() || failure())
with:
name: Test Report
name: Test Report (with Flutter ${{ matrix.flutter-version }})
path: ${{ env.FLUTTER_TEST_REPORT }}
reporter: flutter-json

Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/dry_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ jobs:

- name: Setup Flutter
uses: ./.github/actions/setup_flutter
with:
target: package

- name: Install pana
run: dart pub global activate pana

- name: Run pana
id: analysis
run: |
pana --json package 2>&1 | grep -v '^{"logName"' > pana-report.json
pana --json . 2>&1 | grep -v '^{"logName"' > pana-report.json
JSON_OUTPUT=$(cat pana-report.json | jq -c .)
echo "::set-output name=json_output::$JSON_OUTPUT"
Expand All @@ -32,9 +30,8 @@ jobs:
report: ${{ steps.analysis.outputs.json_output }}
min-convention-points: 30
min-platform-points: 20
min-analysis-points: 50
min-analysis-points: 40
min-dependency-points: 20
supported-platforms: ios, android

- run: flutter pub publish --dry-run
working-directory: package
3 changes: 0 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ jobs:

- name: Setup Flutter
uses: ./.github/actions/setup_flutter
with:
target: package

- name: Setup OIDC token
uses: dart-lang/setup-dart@v1

- name: Publish to pub.dev
run: flutter pub publish --force
working-directory: package
76 changes: 75 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,79 @@
.history
.svn/
migrate_working_dir/
pubspec.lock

# Flutter/Dart/Pub related
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/

# FVM Version Cache
.fvm/

# IntelliJ related
# Source: https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Caches
.idea/caches/
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 91da00c

Please sign in to comment.