Skip to content

Commit 9b388e2

Browse files
committed
add workfow to raspi
1 parent 2813d33 commit 9b388e2

File tree

5 files changed

+68
-27
lines changed

5 files changed

+68
-27
lines changed

.github/actions/build/action.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ runs:
118118
TARGETS=$(echo "${TARGETS_JSON}" | jq -cr '. | join(" ")')
119119
time autoninja -C out/${{ matrix.platform }}_${{ matrix.config }} ${TARGETS}
120120
shell: bash
121+
- name: Archive Evergreen ARM Size Artifacts
122+
if: startsWith(matrix.platform, 'evergreen-arm') && matrix.config == 'gold'
123+
uses: actions/upload-artifact@v4
124+
with:
125+
name: size_artifacts_${{ matrix.platform }}_${{ matrix.config }}
126+
path: |
127+
src/out/${{ matrix.platform }}_${{ matrix.config }}/bin/run_cobalt_sizes
128+
src/out/${{ matrix.platform }}_${{ matrix.config }}/sizes
129+
src/out/${{ matrix.platform }}_${{ matrix.config }}/libcobalt.so
121130
- name: Archive Android APKs
122131
if: startsWith(matrix.platform, 'android') && matrix.config == 'qa'
123132
uses: actions/upload-artifact@v4

.github/workflows/evergreen-arm-hardfp-rdk.yaml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,3 @@ jobs:
3333
nightly: ${{ github.event.inputs.nightly }}
3434
secrets:
3535
datadog_api_key: ${{ secrets.DD_API_KEY }}
36-
37-
check_metrics:
38-
needs: evergreen-arm-hardfp-rdk
39-
runs-on: ubuntu-latest
40-
steps:
41-
- name: Checkout code
42-
uses: actions/checkout@v4
43-
44-
- name: Download build artifacts
45-
uses: actions/download-artifact@v4
46-
with:
47-
name: out
48-
path: out
49-
50-
- name: Check binary size
51-
run: |
52-
out/evergreen-arm-hardfp-rdk_gold/bin/run_cobalt_sizes
53-
54-
- name: Compare binary size
55-
run: |
56-
python3 tools/binary_size/compare_sizes.py \
57-
--current out/evergreen-arm-hardfp-rdk_gold/sizes/perf_results.json \
58-
--reference cobalt/testing/tools/reference_metrics.json \
59-
--platform evergreen-arm-hardfp-rdk \
60-
--config gold

.github/workflows/main.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,38 @@ jobs:
338338
uses: ./src/.github/actions/api_leak_detector
339339
if: inputs.run_api_leak_detector
340340

341+
check_binary_size:
342+
needs: [initialize, build]
343+
runs-on: ubuntu-latest
344+
name: Check Binary Size ${{ matrix.platform }}
345+
strategy:
346+
fail-fast: false
347+
matrix:
348+
platform: ${{ fromJson(needs.initialize.outputs.platforms) }}
349+
include: ${{ fromJson(needs.initialize.outputs.includes) }}
350+
# Only run this job for the 'gold' config
351+
config: ['gold']
352+
# Run only for evergreen-arm platforms and if gold config is in the build list
353+
if: startsWith(matrix.platform, 'evergreen-arm') && contains(fromJson(needs.initialize.outputs.build_configs), 'gold')
354+
steps:
355+
- name: Restore CI Essentials
356+
uses: actions/download-artifact@v4
357+
with:
358+
name: ci-essentials-${{ inputs.platform }}
359+
360+
361+
- name: Check binary size
362+
run: |
363+
out/${{ matrix.platform }}_${{ matrix.config }}/bin/run_cobalt_sizes
364+
365+
- name: Compare binary size
366+
run: |
367+
python3 cobalt/testing/tools/compare_sizes.py \
368+
--current out/${{ matrix.platform }}_${{ matrix.config }}/sizes/perf_results.json \
369+
--reference cobalt/testing/tools/reference_metrics.json \
370+
--platform ${{ matrix.platform }} \
371+
--config ${{ matrix.config }}
372+
341373
on-device-test:
342374
needs: [initialize, build]
343375
if: needs.initialize.outputs.test_on_device == 'true' &&

cobalt/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ if (use_evergreen) {
235235
data = [ "${root_out_dir}/libcobalt.so" ]
236236
executable_args = [
237237
"--platform",
238-
"linux",
238+
"cobalt-evergreen",
239239
"--isolated-script-test-output",
240240
"${root_out_dir}/test_results.json",
241241
]

tools/binary_size/sizes.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,12 @@ def main_linux(output_directory, results_collector, size_path):
242242
"""
243243
assert size_path is None
244244
binaries = [
245-
'libcobalt.so',
245+
'chrome',
246+
'nacl_helper',
247+
'nacl_helper_bootstrap',
248+
'libffmpegsumo.so',
249+
'libgcflashplayer.so',
250+
'libppGoogleNaClPluginChrome.so',
246251
]
247252

248253
result = 0
@@ -384,6 +389,25 @@ def main_win(output_directory, results_collector, size_path):
384389
return 0
385390

386391

392+
def main_cobalt_evergreen(output_directory, results_collector, size_path):
393+
"""Print appropriate size information about built Cobalt Evergreen targets."""
394+
assert size_path is None
395+
binaries = [
396+
'libcobalt.so',
397+
]
398+
399+
result = 0
400+
401+
for binary in binaries:
402+
this_result, this_sizes = check_linux_binary(binary, output_directory)
403+
if result == 0:
404+
result = this_result
405+
for name, identifier, _, value, units in this_sizes:
406+
results_collector.add_result(name, identifier, value, units)
407+
408+
return result
409+
410+
387411
def format_for_histograms_conversion(data):
388412
# We need to do two things to the provided data to make it compatible with the
389413
# conversion script:
@@ -410,6 +434,7 @@ def main():
410434
main_map = {
411435
'android': main_android,
412436
'android-cronet': main_android_cronet,
437+
'cobalt-evergreen': main_cobalt_evergreen,
413438
'linux': main_linux,
414439
'mac': main_mac,
415440
'win': main_win,

0 commit comments

Comments
 (0)