Skip to content

fix(core, windows): building improvements #2869

fix(core, windows): building improvements

fix(core, windows): building improvements #2869

Workflow file for this run

name: e2e
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'website/**'
- '**/example/**'
- '**/flutterfire_ui/**'
- '**/cloud_firestore_odm/**'
- '**.md'
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'website/**'
- '**/example/**'
- '**/flutterfire_ui/**'
- '**/cloud_firestore_odm/**'
- '**.md'
jobs:
android:
runs-on: macos-13
timeout-minutes: 45
strategy:
matrix:
working_directory:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
name: Install Node.js 16
with:
node-version: '16'
- uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
with:
distribution: 'temurin'
java-version: '11'
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0
name: Gradle Cache
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle-v2
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0
name: AVD Cache
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd
- name: Firebase Emulator Cache
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v2-${{ github.run_id }}
restore-keys: firebase-emulators-v2
- uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
run-bootstrap: false
melos-version: '3.0.1'
- name: 'Bootstrap package'
run: melos bootstrap --scope tests
- name: 'Install Tools'
run: |
sudo npm i -g firebase-tools
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: Create and start emulator
# We use the installed SDK in the macOS image to create and start the emulator
run: |
echo "List installed packages"
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --list_installed
echo "Installing system image"
echo "y" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager "system-images;android-33;google_apis;x86_64"
echo "Creating AVD"
echo "no" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager create avd -n test_emulator -k "system-images;android-33;google_apis;x86_64" --force
echo "Starting emulator"
$ANDROID_SDK_ROOT/emulator/emulator -avd test_emulator -no-audio -no-boot-anim -no-window &
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'
- name: 'E2E Tests'
working-directory: ${{ matrix.working_directory }}
run: |
flutter test integration_test/e2e_test.dart --dart-define=CI=true
ios:
runs-on: macos-13
timeout-minutes: 45
strategy:
matrix:
working_directory:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
name: Install Node.js 16
with:
node-version: '16'
- uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
with:
distribution: 'temurin'
java-version: '11'
- uses: hendrikmuhs/ccache-action@fba817f3c0db4f854d7a3ee688241d6754da166e
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-ios-v3
max-size: 700M
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0
name: Pods Cache
id: pods-cache
with:
path: tests/ios/Pods
key: ${{ runner.os }}-pods-v3-${{ hashFiles('tests/ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-ios-pods-v2
- name: Firebase Emulator Cache
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v1-${{ github.run_id }}
restore-keys: firebase-emulators-v1
- uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
run-bootstrap: false
melos-version: '3.0.1'
- name: 'Bootstrap package'
run: melos bootstrap --scope tests
- name: 'Install Tools'
run: |
sudo npm i -g firebase-tools
- name: 'Build Application'
working-directory: ${{ matrix.working_directory }}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
ccache -s
flutter build ios --no-codesign --simulator --debug --target=./integration_test/e2e_test.dart --dart-define=CI=true
ccache -s
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: 'E2E Tests'
working-directory: ${{ matrix.working_directory }}
run: |
# Boot simulator and wait for System app to be ready.
# List of available simulators: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#installed-simulators
SIMULATOR="iPhone 14"
xcrun simctl bootstatus "$SIMULATOR" -b
xcrun simctl logverbose "$SIMULATOR" enable
# Sleep to allow simulator to settle.
sleep 15
# Uncomment following line to have simulator logs printed out for debugging purposes.
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
flutter test integration_test/e2e_test.dart -d "$SIMULATOR" --dart-define=CI=true
FLUTTER_DRIVE_EXIT_CODE=$?
xcrun simctl shutdown "$SIMULATOR"
exit $FLUTTER_DRIVE_EXIT_CODE
macos:
runs-on: macos-13
timeout-minutes: 45
strategy:
matrix:
working_directory:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
name: Install Node.js 16
with:
node-version: '16'
- uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
with:
distribution: 'temurin'
java-version: '11'
- uses: hendrikmuhs/ccache-action@fba817f3c0db4f854d7a3ee688241d6754da166e
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-macos-v2
max-size: 700M
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0
name: Pods Cache
id: pods-cache
with:
path: tests/macos/Pods
key: ${{ runner.os }}-pods-v2-${{ hashFiles('tests/macos/Podfile.lock') }}
restore-keys: ${{ runner.os }}-macos-pods-v1
- name: Cache Firebase Emulator
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v1-${{ github.run_id }}
restore-keys: firebase-emulators-v1
- uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
run-bootstrap: false
melos-version: '3.0.1'
- name: 'Bootstrap package'
run: melos bootstrap --scope tests
- name: 'Install Tools'
run: |
sudo npm i -g firebase-tools
- name: 'Build Application'
working-directory: ${{ matrix.working_directory }}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
ccache -s
flutter build macos --debug --target=./integration_test/e2e_test.dart --device-id=macos --dart-define=CI=true
ccache -s
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: 'E2E Tests'
working-directory: ${{ matrix.working_directory }}
run: |
flutter test \
integration_test/e2e_test.dart \
-d macos \
--dart-define=CI=true
web:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
working_directory:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
name: Install Node.js 16
with:
node-version: '16'
- uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
with:
distribution: 'temurin'
java-version: '11'
- uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
run-bootstrap: false
melos-version: '3.0.1'
- name: 'Bootstrap package'
run: melos bootstrap --scope tests
- name: 'Install Tools'
run: |
sudo npm i -g firebase-tools
- name: Cache Firebase Emulator
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v1-${{ github.run_id }}
restore-keys: firebase-emulators-v1
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: 'E2E Tests'
working-directory: ${{ matrix.working_directory }}
# Web devices are not supported for the `flutter test` command yet. As a
# workaround we can use the `flutter drive` command. Tracking issue:
# https://github.com/flutter/flutter/issues/66264
run: |
chromedriver --port=4444 &
flutter drive \
--verbose-system-logs \
-d web-server \
--driver=test_driver/integration_test.dart \
--target=integration_test/e2e_test.dart \
--dart-define=CI=true
windows:
runs-on: windows-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
name: Install Node.js 16
with:
node-version: "16"
- uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
run-bootstrap: false
melos-version: '3.0.0'
- name: "Bootstrap package"
run: melos bootstrap --scope tests
- name: "Install Tools"
run: |
npm install -g firebase-tools
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
working-directory: tests
run: |
flutter test .\integration_test\e2e_test.dart -d windows