Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into cupertino_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan committed Mar 21, 2024
2 parents 4af722d + 988b4d4 commit b80eaf9
Show file tree
Hide file tree
Showing 137 changed files with 4,191 additions and 3,004 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/cronet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,28 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
package: ['cronet_http', 'cronet_http_embedded']
cronetHttpNoPlay: ['false', 'true']
defaults:
run:
working-directory: pkgs/cronet_http
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
- uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
channel: 'stable'
- name: Make cronet_http_embedded copy
if: ${{ matrix.package == 'cronet_http_embedded' }}
run: |
mv pkgs/cronet_http pkgs/cronet_http_embedded
cd pkgs/cronet_http_embedded
flutter pub get && dart tool/prepare_for_embedded.dart
- id: install
name: Install dependencies
working-directory: 'pkgs/${{ matrix.package }}'
run: flutter pub get
- name: Check formatting
working-directory: 'pkgs/${{ matrix.package }}'
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
run: dart format --output=none --set-exit-if-changed .
- name: Analyze code
working-directory: 'pkgs/${{ matrix.package }}'
run: flutter analyze --fatal-infos
if: always() && steps.install.outcome == 'success'
run: flutter analyze --fatal-infos
- name: Run tests
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2
if: always() && steps.install.outcome == 'success'
Expand All @@ -64,6 +58,6 @@ jobs:
# - pkgs/cronet_http/example/android/app/build.gradle
api-level: 21
arch: x86_64
target: ${{ matrix.package == 'cronet_http_embedded' && 'default' || 'google_apis' }}
target: ${{ matrix.cronetHttpNoPlay == 'true' && 'default' || 'google_apis' }}
profile: pixel
script: cd 'pkgs/${{ matrix.package }}/example' && flutter test --timeout=1200s integration_test/
script: cd pkgs/cronet_http/example && flutter test --dart-define=cronetHttpNoPlay=${{ matrix.cronetHttpNoPlay }} --timeout=1200s integration_test/
57 changes: 17 additions & 40 deletions .github/workflows/cupertino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,37 @@ on:
- main
- master
paths:
- '.github/workflows/cupertino.yml'
- 'pkgs/cupertino_http/**'
- 'pkgs/http_client_conformance_tests/**'
- '.github/workflows/cupertino.yml'
pull_request:
paths:
- '.github/workflows/cupertino.yml'
- 'pkgs/cupertino_http/**'
- 'pkgs/http_client_conformance_tests/**'
- '.github/workflows/cupertino.yml'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github

jobs:
analyze:
name: Lint and static analysis
runs-on: ubuntu-latest
verify:
name: Format & Analyze & Test
runs-on: macos-latest
defaults:
run:
working-directory: pkgs/cupertino_http
strategy:
matrix:
# Test on the minimum supported flutter version and the latest
# version.
flutter-version: ["3.19.0", "any"]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
flutter-version: ${{ matrix.flutter-version }}
channel: 'stable'
- id: install
name: Install dependencies
Expand All @@ -40,48 +46,19 @@ jobs:
# This approach is simpler than using `find` and excluding that file
# because `dart format` also excludes other file e.g. ones in
# directories start with '.'.
run: >
mv lib/src/native_cupertino_bindings.dart lib/src/native_cupertino_bindings.tmp &&
dart format --output=none --set-exit-if-changed . &&
run: |
mv lib/src/native_cupertino_bindings.dart lib/src/native_cupertino_bindings.tmp
dart format --output=none --set-exit-if-changed .
mv lib/src/native_cupertino_bindings.tmp lib/src/native_cupertino_bindings.dart
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: flutter analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

test:
# Test package:cupertino_http use flutter integration tests.
needs: analyze
name: "Build and test"
strategy:
matrix:
# Test on the minimum supported flutter version and the latest
# version.
flutter-version: ["3.16.0", "any"]
runs-on: macos-latest
defaults:
run:
working-directory: pkgs/cupertino_http/example
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: futureware-tech/simulator-action@bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9
with:
model: 'iPhone 8'
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
flutter-version: ${{ matrix.flutter-version }}
channel: 'stable'
- name: Run tests
# TODO: Remove the retries when
# https://github.com/flutter/flutter/issues/121231 is fixed.
# See https://github.com/dart-lang/http/issues/938 for context.
run: |
for i in {1..6}
do
flutter test integration_test/main.dart && break
if [ $i -eq 6 ]
then
exit 1
fi
echo "Retry $i"
done
cd example
flutter pub get
flutter test --timeout=1200s integration_test/main.dart
Loading

0 comments on commit b80eaf9

Please sign in to comment.