Skip to content

[objective_c] Migrate to native assets #1373

[objective_c] Migrate to native assets

[objective_c] Migrate to native assets #1373

Workflow file for this run

name: objective_c
on:
# Run on PRs and pushes to the default branch.
push:
branches: [main]
paths:
- '.github/workflows/objective_c.yaml'
- 'pkgs/ffigen/**'
- 'pkgs/native_test_helpers/**'
- 'pkgs/objective_c/**'
pull_request:
branches: [main]
paths:
- '.github/workflows/objective_c.yaml'
- 'pkgs/ffigen/**'
- 'pkgs/native_test_helpers/**'
- 'pkgs/objective_c/**'
schedule:
- cron: "0 0 * * 0"
env:
PUB_ENVIRONMENT: bot.github
jobs:
# Check code formatting and static analysis.
analyze:
runs-on: macos-latest
defaults:
run:
working-directory: pkgs/objective_c/
strategy:
fail-fast: false
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: stable
- id: install
name: Install dependencies
run: flutter pub get && flutter pub get --directory="example/command_line" && flutter pub get --directory="example/flutter_app"
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: flutter analyze --fatal-infos
if: always() && steps.install.outcome == 'success'
test-mac:
needs: analyze
runs-on: 'macos-latest'
defaults:
run:
working-directory: pkgs/objective_c/
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: stable
- name: Install dependencies
run: dart pub get
- name: Install coverage
run: dart pub global activate coverage
- name: Run VM tests and collect coverage
run: dart pub global run coverage:test_with_coverage --scope-output=ffigen --scope-output=objective_c
- name: Verify generated code is up to date
# test/generate_code_test.dart runs the code generator, so if there are
# any git-diffs at this point, it means the generated code is outdated.
run: if [[ -n $(git status --porcelain | tee /dev/stderr) ]]; then echo -e "\nDIFF:"; git diff; false; fi
- name: Upload coverage
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
with:
flag-name: objective_c
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
path-to-lcov: pkgs/objective_c/coverage/lcov.info
- name: Upload coverage
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
with:
carryforward: "ffigen,jni,jnigen,native_pkgs_macos,native_pkgs_ubuntu,native_pkgs_windows,objective_c,swift2objc,swiftgen"
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
build-flutter-example:
needs: analyze
runs-on: 'macos-latest'
defaults:
run:
working-directory: pkgs/objective_c/example/flutter_app
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
with:
channel: stable
- name: Install dependencies
run: flutter pub get
- name: Build the example app for macos
run: flutter build macos
- name: Build the example app for ios
run: flutter build ios --no-codesign
- name: Check for xcode for analyzer warnings
run: xcodebuild analyze -workspace macos/Runner.xcworkspace -scheme Runner -configuration Debug GCC_TREAT_WARNINGS_AS_ERRORS=YES
build-command-line-example:
needs: analyze
runs-on: 'macos-latest'
defaults:
run:
working-directory: pkgs/objective_c/example/command_line
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: stable
- name: Install dependencies
run: dart pub get
- name: Run the example app
run: dart run lib/main.dart