Skip to content

Commit

Permalink
👷 Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Dec 24, 2023
1 parent 15ec3ba commit 0e0e655
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 137 deletions.
62 changes: 18 additions & 44 deletions .github/workflows/cupertino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,41 @@ 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.10.0", "any"]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
channel: 'stable'
- uses: futureware-tech/simulator-action@v3
with:
model: 'iPhone 8'
- id: install
name: Install dependencies
run: flutter pub get
Expand All @@ -40,48 +49,13 @@ 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.10.0", "any"]
runs-on: macos-latest
defaults:
run:
working-directory: pkgs/cupertino_http/example
steps:
- uses: actions/checkout@v4
- uses: futureware-tech/simulator-action@v3
with:
model: 'iPhone 8'
- uses: subosito/flutter-action@v2
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
run: flutter test --timeout=1200s integration_test/
73 changes: 5 additions & 68 deletions .github/workflows/dart.yml

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

31 changes: 6 additions & 25 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
- main
- master
paths:
- 'pkgs/java_http/**'
- 'pkgs/http_client_conformance_tests/**'
- '.github/workflows/java.yml'
- 'pkgs/http_client_conformance_tests/**'
- 'pkgs/java_http/**'
pull_request:
paths:
- 'pkgs/java_http/**'
- 'pkgs/http_client_conformance_tests/**'
- '.github/workflows/java.yml'
- 'pkgs/http_client_conformance_tests/**'
- 'pkgs/java_http/**'
schedule:
# Runs every Sunday at midnight (00:00 UTC).
- cron: "0 0 * * 0"
Expand All @@ -22,8 +22,8 @@ env:
PUB_ENVIRONMENT: bot.github

jobs:
analyze:
name: Lint and static analysis
verify:
name: Format & Analyze & Test
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -33,35 +33,16 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- id: install
name: Install dependencies
run: dart pub get

- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'

- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

test:
needs: analyze
name: Build and test
runs-on: ubuntu-latest
defaults:
run:
working-directory: pkgs/java_http

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Build jni dynamic libraries
run: dart run jni:setup

- name: Run tests
run: dart test

0 comments on commit 0e0e655

Please sign in to comment.