Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: move to macOS 13 runner #10841

Merged
merged 32 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0501369
ci: move to macOS 13 XL runner
Lyokone Apr 25, 2023
79b8bdf
ci: update iOS simulator
Lyokone Apr 25, 2023
3df055b
ci: update iOS simulator
Lyokone Apr 25, 2023
bf9357e
ci: move firebase_performance to main tests
Lyokone Apr 25, 2023
b952e12
ci: move firebase_performance to main tests
Lyokone Apr 25, 2023
81bf47e
ci: update flutter version for macos
Lyokone Apr 25, 2023
f4366a4
ci: update flutter version for macos
Lyokone Apr 25, 2023
b5ce743
ci: tests
Lyokone Apr 25, 2023
c730f3b
ci: tests
Lyokone Apr 25, 2023
7bbad52
ci: tests
Lyokone Apr 25, 2023
dee7be2
ci: tests
Lyokone Apr 25, 2023
a0a980b
ci: tests
Lyokone Apr 25, 2023
09189b3
ci: tests
Lyokone Apr 25, 2023
9819327
ci: tests
Lyokone Apr 25, 2023
42c93c1
ci: tests
Lyokone Apr 26, 2023
19e56e0
ci: tests
Lyokone Apr 26, 2023
25f0021
ci: tests
Lyokone Apr 26, 2023
8af293a
ci: tests
Lyokone Apr 26, 2023
99c55ef
ci: tests
Lyokone Apr 26, 2023
b40e1f4
ci: tests
Lyokone Apr 26, 2023
dc5213d
ci: tests
Lyokone Apr 26, 2023
e79a22f
ci: tests
Lyokone Apr 26, 2023
4f8f33e
ci: final
Lyokone Apr 26, 2023
dd208cb
ci: manual android emulator
Lyokone Apr 27, 2023
d0882ab
ci: manual android emulator
Lyokone Apr 27, 2023
b8d79c0
ci: manual android emulator
Lyokone Apr 27, 2023
14eb60e
ci: fix android notification request and cloud firestore package name
Lyokone Apr 27, 2023
34a92fc
ci: fix android notification request and cloud firestore package name
Lyokone Apr 27, 2023
cf61a96
ci: fix android notification request and cloud firestore package name
Lyokone Apr 27, 2023
7505849
ci: fix android notification request and cloud firestore package name
Lyokone Apr 27, 2023
5945b27
ci: fix android notification request and cloud firestore package name
Lyokone Apr 27, 2023
9606a25
ci: fix android notification request and cloud firestore package name
Lyokone Apr 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/all_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
melos-version: '3.0.0-dev.0'
melos-version: '3.0.1'
- name: 'Run Analyze'
run: melos run analyze

Expand All @@ -48,7 +48,7 @@ jobs:
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
melos-version: '3.0.0-dev.0'
melos-version: '3.0.1'
- name: 'Pub Check'
run: |
melos exec -c 1 --no-private --ignore="*example*" -- \
Expand All @@ -65,7 +65,7 @@ jobs:
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
melos-version: '3.0.0-dev.0'
melos-version: '3.0.1'
- name: 'Flutter Pub Get'
run: |
melos exec -c 1 --scope="*example*" -- \
Expand All @@ -82,7 +82,7 @@ jobs:
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
melos-version: '3.0.0-dev.0'
melos-version: '3.0.1'
- uses: Homebrew/actions/setup-homebrew@master
- name: 'Install Tools'
run: |
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
melos-version: '3.0.0-dev.0'
melos-version: '3.0.1'
- name: 'Build Examples'
run: |
melos exec -c 1 --scope="*example*" --dir-exists="web" -- \
Expand All @@ -132,7 +132,7 @@ jobs:
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
melos-version: '3.0.0-dev.0'
melos-version: '3.0.1'
- name: 'Flutter Test'
run: melos run test --no-select
- name: 'Flutter Test - Web'
Expand All @@ -157,6 +157,6 @@ jobs:
# Running `melos bootstrap` is not needed because we use Melos just
# for the `check-license-header` script.
run-bootstrap: false
melos-version: '3.0.0-dev.0'
melos-version: '3.0.1'
- name: Check license header
run: melos run check-license-header
98 changes: 46 additions & 52 deletions .github/workflows/e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ on:

jobs:
android:
runs-on: macos-12
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
Expand All @@ -45,21 +48,13 @@ jobs:
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: Generate AVD snapshot for caching
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am surprised this yields a positive result! Really cool if so.

What I observed on multiple runs where the AVD cache was pre-generated (before API33 at least...) was lower performance on the first run (obviously) but if the AVD cache was pushed on main branch only so it wasn't evicted from github's cache, subsequent runs on main and all PR branches were much faster as a performance benefit

What I further observed was that the emulator performs lots of "first run" type things on it's first boot, so when I gave the emulator time to do that during AVD cache generation - meaning it was already "warm" for cache hits, I actually had greater stability as well, since there were some "first run" type things that failed sometimes (Zygote initial memory setting, for instance, or just race conditions with test operations) that resulted in better AVD stability on cache-hit runs / less flakes, as a stability benefit

If your new CI AVD strategy results in similar or better performance and stability, I need to look at this in react-native-firebase

if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0
with:
api-level: 30
arch: x86_64
target: google_apis
profile: Nexus 5X
script: echo "Generated AVD snapshot for caching"
- name: Firebase Emulator Cache
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0
with:
Expand All @@ -73,47 +68,40 @@ jobs:
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
run-bootstrap: false
melos-version: '3.0.0-dev.0'
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: tests
run: |
flutter build apk --debug --target=./integration_test/e2e_test.dart --dart-define=CI=true --no-android-gradle-daemon
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0
timeout-minutes: 30
with:
api-level: 30
arch: x86_64
target: google_apis
profile: Nexus 5X
working-directory: tests
script: |
sleep 15
$ANDROID_HOME/platform-tools/adb logcat '*:D' > adb-log.txt &
flutter test integration_test/e2e_test.dart --dart-define=CI=true
- name: Compress Emulator Log
if: always()
run: cd tests/ && gzip -9 adb-log.txt
shell: bash

- name: Upload Emulator Log
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
if: always()
with:
name: ${{ matrix.api-level }}-${{ matrix.arch }}-${{matrix.target}}-${{matrix.first-boot-delay}}-${{matrix.iteration}}-adb_logs
path: tests/adb-log.txt.gz
- 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-12
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
Expand Down Expand Up @@ -149,14 +137,14 @@ jobs:
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
run-bootstrap: false
melos-version: '3.0.0-dev.0'
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: tests
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
Expand All @@ -169,10 +157,11 @@ jobs:
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
working-directory: tests
working-directory: ${{ matrix.working_directory }}
run: |
# Boot simulator and wait for System app to be ready.
SIMULATOR="iPhone 11"
# 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.
Expand All @@ -185,8 +174,11 @@ jobs:
exit $FLUTTER_DRIVE_EXIT_CODE

macos:
runs-on: macos-12
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
Expand Down Expand Up @@ -217,20 +209,19 @@ jobs:
restore-keys: firebase-emulators-v1
- uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d
with:
# TODO(Lyokone): upgrade to stable when https://github.com/flutter/flutter/issues/118469 is closed
flutter-version: '3.3.10'
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
run-bootstrap: false
melos-version: '3.0.0-dev.0'
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: tests
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
Expand All @@ -243,7 +234,7 @@ jobs:
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
working-directory: tests
working-directory: ${{ matrix.working_directory }}
run: |
flutter test \
integration_test/e2e_test.dart \
Expand All @@ -253,6 +244,9 @@ jobs:
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
Expand All @@ -270,7 +264,7 @@ jobs:
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
run-bootstrap: false
melos-version: '3.0.0-dev.0'
melos-version: '3.0.1'
- name: "Bootstrap package"
run: melos bootstrap --scope tests
- name: "Install Tools"
Expand All @@ -285,7 +279,7 @@ jobs:
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
working-directory: 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
Expand Down
123 changes: 0 additions & 123 deletions .github/workflows/firebase_firestore.yaml

This file was deleted.

Loading