Skip to content

Commit 29c5733

Browse files
authored
Improve the reliability of cronet_http/ok_http workflows (#1736)
1 parent dd56b86 commit 29c5733

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

.github/workflows/cronet.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ env:
2323
jobs:
2424
verify:
2525
name: Format & Analyze & Test
26-
runs-on: ubuntu-latest
27-
timeout-minutes: 20
26+
runs-on: ubuntu-cpu16-ram64
27+
timeout-minutes: 30
2828
strategy:
2929
fail-fast: false
3030
matrix:
@@ -33,10 +33,6 @@ jobs:
3333
run:
3434
working-directory: pkgs/cronet_http
3535
steps:
36-
- name: Delete unnecessary tools 🔧
37-
uses: jlumbroso/[email protected]
38-
with:
39-
android: false # Don't remove Android tools
4036
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
4137
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
4238
with:
@@ -54,6 +50,11 @@ jobs:
5450
- name: Analyze code
5551
if: always() && steps.install.outcome == 'success'
5652
run: flutter analyze --fatal-infos
53+
- name: Enable KVM group perms
54+
run: |
55+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
56+
sudo udevadm control --reload-rules
57+
sudo udevadm trigger --name-match=kvm
5758
- name: Run tests
5859
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d
5960
if: always() && steps.install.outcome == 'success'
@@ -62,7 +63,15 @@ jobs:
6263
# - .github/workflows/cronet.yml
6364
# - pkgs/cronet_http/android/build.gradle
6465
# - pkgs/cronet_http/example/android/app/build.gradle
65-
api-level: 21
66+
67+
# Google Play services does not support older Android API levels;
68+
# as of March 2025, they supported API level 23 and higher. Instead
69+
# of breaking when support for API level 23 is removed, just run
70+
# the tests that rely on Google Play services with the newest API
71+
# level (34 as of March 2025). The tests that don't rely on Google
72+
# Play serviecs can test the oldest supported API level.
73+
api-level: ${{ matrix.cronetHttpNoPlay == 'true' && '21' || '29' }}
74+
disable-animations: true
6675
arch: x86_64
6776
target: ${{ matrix.cronetHttpNoPlay == 'true' && 'default' || 'google_apis' }}
6877
script: cd pkgs/cronet_http/example && flutter test --dart-define=cronetHttpNoPlay=${{ matrix.cronetHttpNoPlay }} --timeout=1200s integration_test/

.github/workflows/okhttp.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
- main
77
- master
88
paths:
9-
- '.github/workflows/okhttp.yml'
9+
- '.github/workflows/okhttp.yaml'
1010
- 'pkgs/ok_http/**'
1111
- 'pkgs/http_client_conformance_tests/**'
1212
pull_request:
1313
paths:
14-
- '.github/workflows/okhttp.yml'
14+
- '.github/workflows/okhttp.yaml'
1515
- 'pkgs/ok_http/**'
1616
- 'pkgs/http_client_conformance_tests/**'
1717
schedule:
@@ -23,7 +23,7 @@ env:
2323
jobs:
2424
verify:
2525
name: Format & Analyze & Test
26-
runs-on: ubuntu-latest
26+
runs-on: ubuntu-cpu16-ram64
2727
defaults:
2828
run:
2929
working-directory: pkgs/ok_http
@@ -45,6 +45,11 @@ jobs:
4545
- name: Analyze code
4646
if: always() && steps.install.outcome == 'success'
4747
run: flutter analyze --fatal-infos
48+
- name: Enable KVM group perms
49+
run: |
50+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
51+
sudo udevadm control --reload-rules
52+
sudo udevadm trigger --name-match=kvm
4853
- name: Run tests
4954
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d
5055
if: always() && steps.install.outcome == 'success'

0 commit comments

Comments
 (0)