Skip to content

Replace HTTP server #2181

Replace HTTP server

Replace HTTP server #2181

Workflow file for this run

name: patrol prepare
on:
workflow_dispatch:
pull_request:
paths:
- 'packages/patrol/**'
jobs:
prepare-android-on-windows:
runs-on: ${{ matrix.os }}
name: Android on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
defaults:
run:
working-directory: packages/patrol/example/android
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.x'
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Generate Gradle wrapper
working-directory: packages/patrol/example
run: flutter build apk --debug --flavor=does-not-exist || true
- name: ktlint check
run: .\gradlew.bat :patrol:ktlintCheck
- name: ktlint format
run: .\gradlew.bat :patrol:ktlintFormat
- name: Build app with Gradle
run: .\gradlew.bat :app:assembleDebug
- name: Build app with Flutter tool
run: flutter build apk --debug
prepare-android-on-linux:
runs-on: ${{ matrix.os }}
name: Android on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
defaults:
run:
working-directory: packages/patrol/example/android
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.x'
- name: Generate Gradle wrapper
working-directory: packages/patrol/example
run: flutter build apk --debug --flavor=does-not-exist || true
- name: Run unit tests
if: success() || failure()
run: ./gradlew :patrol:testDebug
- name: ktlint check
if: success() || failure()
run: ./gradlew :patrol:ktlintCheck
- name: ktlint format
if: success() || failure()
run: ./gradlew :patrol:ktlintFormat
- name: Build example app with Gradle
run: ./gradlew :app:assembleDebug
- name: Build example app with Flutter tool
run: flutter build apk --debug
prepare-ios:
runs-on: ${{ matrix.os }}
name: iOS on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
defaults:
run:
working-directory: packages/patrol/ios
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install tools
run: |
brew update
brew install swift-format
brew install clang-format
brew install xcbeautify
# Disabled because of generated protobuf code
#- name: swift-format lint
# run: test -z $(swift-format lint --recursive --strict .)
- name: swift-format format
run: |
swift-format format --recursive --in-place .
git update-index --refresh
git diff-index --quiet HEAD --
- name: clang-format
run: |
find . -iname '*.h' -o -iname '*.m' | xargs -I {} clang-format --dry-run --Werror {}
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.x'
- name: Generate iOS build files
working-directory: packages/patrol/example
run: flutter build ios --config-only --simulator
- name: Start iOS simulator
uses: futureware-tech/simulator-action@v2
with:
model: iPhone 14
os: iOS
os_version: 16.2
erase_before_boot: true
shutdown_after_job: true
- name: Run unit tests
working-directory: packages/patrol/example/ios
run: |
set -o pipefail
xcodebuild test \
-workspace Runner.xcworkspace \
-scheme Runner \
-only-testing RunnerTests \
-configuration Debug \
-sdk iphoneos -destination 'platform=iOS Simulator,name=iPhone 14' \
-derivedDataPath ../build/ios_unit | xcbeautify --renderer github-actions
prepare-flutter:
name: Flutter ${{ matrix.flutter-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
flutter-version: ['3.3.x', '3.7.x', '3.10.x', '3.13.x']
defaults:
run:
working-directory: packages/patrol
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
- name: flutter pub get
run: flutter pub get
- name: flutter test
if: success() || failure()
run: flutter test --coverage
- name: flutter analyze
if: success() || failure()
run: flutter analyze
- name: dart format
if: ${{ (success() || failure()) && (contains('3.10.x', matrix.flutter-version) || contains('3.13.x', matrix.flutter-version)) }}
run: dart format --set-exit-if-changed .
- name: flutter pub publish --dry-run
if: success() || failure()
run: flutter pub publish --dry-run
- name: flutter pub get (example app)
if: success() || failure()
working-directory: ./packages/patrol/example
run: flutter pub get