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

mobile/ci: Improve mobile jobs #27404

Merged
merged 4 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Environment

on:
workflow_call:
outputs:
mobile_android_build:
value: ${{ jobs.mobile.outputs.mobile_android_build }}
mobile_android_build_all:
value: ${{ jobs.mobile.outputs.mobile_android_build_all }}
mobile_android_tests:
value: ${{ jobs.mobile.outputs.mobile_android_tests }}
mobile_asan:
value: ${{ jobs.mobile.outputs.mobile_asan }}
mobile_cc_tests:
value: ${{ jobs.mobile.outputs.mobile_cc_tests }}
mobile_compile_time_options:
value: ${{ jobs.mobile.outputs.mobile_compile_time_options }}
mobile_coverage:
value: ${{ jobs.mobile.outputs.mobile_coverage }}
mobile_formatting:
value: ${{ jobs.mobile.outputs.mobile_formatting }}
mobile_ios_build:
value: ${{ jobs.mobile.outputs.mobile_ios_build }}
mobile_ios_build_all:
value: ${{ jobs.mobile.outputs.mobile_ios_build_all }}
mobile_ios_tests:
value: ${{ jobs.mobile.outputs.mobile_ios_tests }}
mobile_release_validation:
value: ${{ jobs.mobile.outputs.mobile_release_validation }}
mobile_tsan:
value: ${{ jobs.mobile.outputs.mobile_tsan }}

concurrency:
group: ${{ github.head_ref || github.run_id }}-${{ github.workflow }}-env
cancel-in-progress: true

jobs:
mobile:
if: github.repository == 'envoyproxy/envoy'
runs-on: ubuntu-20.04
outputs:
mobile_android_build: ${{ steps.should_run.outputs.mobile_android_build }}
mobile_android_build_all: ${{ steps.should_run.outputs.mobile_android_build_all }}
mobile_android_tests: ${{ steps.should_run.outputs.mobile_android_tests }}
mobile_asan: ${{ steps.should_run.outputs.mobile_asan }}
mobile_cc_tests: ${{ steps.should_run.outputs.mobile_cc_tests }}
mobile_compile_time_options: ${{ steps.should_run.outputs.mobile_compile_time_options }}
mobile_coverage: ${{ steps.should_run.outputs.mobile_coverage }}
mobile_formatting: ${{ steps.should_run.outputs.mobile_formatting }}
mobile_ios_build: ${{ steps.should_run.outputs.mobile_ios_build }}
mobile_ios_build_all: ${{ steps.should_run.outputs.mobile_ios_build_all }}
mobile_ios_tests: ${{ steps.should_run.outputs.mobile_ios_tests }}
mobile_release_validation: ${{ steps.should_run.outputs.mobile_release_validation }}
mobile_tsan: ${{ steps.should_run.outputs.mobile_tsan }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- id: should_run
name: 'Check what to run'
run: |
./mobile/tools/what_to_run.sh
81 changes: 25 additions & 56 deletions .github/workflows/mobile-android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ on:
pull_request:

concurrency:
group: ${{ github.head_ref-github.workflow || github.run_id }}
group: ${{ github.head_ref || github.run_id }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
env:
if: ${{ github.repository == 'envoyproxy/envoy' }}
uses: ./.github/workflows/env.yml
secrets: inherit

androidbuild:
if: github.repository == 'envoyproxy/envoy'
if: ${{ needs.env.outputs.mobile_android_build == 'true' }}
needs: env
name: android_build
runs-on: ubuntu-20.04
timeout-minutes: 90
Expand All @@ -23,15 +29,9 @@ jobs:
CXX: /opt/llvm/bin/clang++
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- id: should_run
name: 'Check whether to run'
run: ./mobile/tools/should_run_ci.sh
- name: 'Build envoy.aar distributable'
if: steps.should_run.outputs.run_ci_job == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -40,31 +40,26 @@ jobs:
--fat_apk_cpu=x86_64 \
--linkopt=-fuse-ld=lld \
//:android_dist

javahelloworld:
if: github.repository == 'envoyproxy/envoy'
if: ${{ needs.env.outputs.mobile_android_build_all == 'true' }}
needs:
- env
- androidbuild
name: java_helloworld
needs: androidbuild
runs-on: macos-12
timeout-minutes: 50
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: should_run
name: 'Check whether to run'
run: ./mobile/tools/should_run_ci.sh
- uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2
if: steps.should_run.outputs.run_ci_job == 'true'
with:
java-version: '8'
java-package: jdk
architecture: x64
distribution: zulu
- run: cd mobile && ./ci/mac_ci_setup.sh --android
if: steps.should_run.outputs.run_ci_job == 'true'
name: 'Install dependencies'
- uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
if: steps.should_run.outputs.run_ci_job == 'true'
name: 'Start emulator'
with:
timeout_minutes: 10
Expand All @@ -74,7 +69,6 @@ jobs:
# cd mobile && ./bazelw mobile-install --fat_apk_cpu=x86_64 --start_app //examples/java/hello_world:hello_envoy
# When https://github.com/envoyproxy/envoy-mobile/issues/853 is fixed.
- name: 'Start java app'
if: steps.should_run.outputs.run_ci_job == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -85,7 +79,6 @@ jobs:
adb install -r --no-incremental bazel-bin/examples/java/hello_world/hello_envoy.apk
adb shell am start -n io.envoyproxy.envoymobile.helloenvoy/.MainActivity
- name: 'Check connectivity'
if: steps.should_run.outputs.run_ci_job == 'true'
run: |
timeout 30 adb logcat -e "received headers with status 301" -m 1 || {
echo "Failed checking for headers in adb logcat" >&2
Expand All @@ -95,30 +88,24 @@ jobs:
exit 1
}
kotlinhelloworld:
if: github.repository == 'envoyproxy/envoy'
if: ${{ needs.env.outputs.mobile_android_build == 'true' }}
needs:
- env
- androidbuild
name: kotlin_helloworld
needs: androidbuild
runs-on: macos-12
timeout-minutes: 50
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: should_run
name: 'Check whether to run'
run: ./mobile/tools/should_run_ci.sh
- uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2
if: steps.should_run.outputs.run_ci_job == 'true'
with:
java-version: '8'
java-package: jdk
architecture: x64
distribution: zulu
- name: 'Install dependencies'
if: steps.should_run.outputs.run_ci_job == 'true'
run: cd mobile && ./ci/mac_ci_setup.sh --android
- uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
if: steps.should_run.outputs.run_ci_job == 'true'
name: 'Start emulator'
with:
timeout_minutes: 10
Expand All @@ -128,7 +115,6 @@ jobs:
# ./bazelw mobile-install --fat_apk_cpu=x86_64 --start_app //examples/kotlin/hello_world:hello_envoy_kt
# When https://github.com/envoyproxy/envoy-mobile/issues/853 is fixed.
- name: 'Start kotlin app'
if: steps.should_run.outputs.run_ci_job == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -139,7 +125,6 @@ jobs:
adb install -r --no-incremental bazel-bin/examples/kotlin/hello_world/hello_envoy_kt.apk
adb shell am start -n io.envoyproxy.envoymobile.helloenvoykotlin/.MainActivity
- name: 'Check connectivity'
if: steps.should_run.outputs.run_ci_job == 'true'
run: |
timeout 30 adb logcat -e "received headers with status 200" -m 1 || {
echo "Failed checking for headers in adb logcat" >&2
Expand All @@ -150,30 +135,24 @@ jobs:
}

kotlinbaselineapp:
if: github.repository == 'envoyproxy/envoy'
if: ${{ needs.env.outputs.mobile_android_build_all == 'true' }}
needs:
- env
- androidbuild
name: kotlin_baseline_app
needs: androidbuild
runs-on: macos-12
timeout-minutes: 50
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: should_run
name: 'Check whether to run'
run: ./mobile/tools/should_run_ci.sh
- uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2
if: steps.should_run.outputs.run_ci_job == 'true'
with:
java-version: '8'
java-package: jdk
architecture: x64
distribution: zulu
- name: 'Install dependencies'
if: steps.should_run.outputs.run_ci_job == 'true'
run: cd mobile && ./ci/mac_ci_setup.sh --android
- uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
if: steps.should_run.outputs.run_ci_job == 'true'
name: 'Start emulator'
with:
timeout_minutes: 10
Expand All @@ -183,7 +162,6 @@ jobs:
# ./bazelw mobile-install --fat_apk_cpu=x86_64 --start_app //examples/kotlin/hello_world:hello_envoy_kt
# When https://github.com/envoyproxy/envoy-mobile/issues/853 is fixed.
- name: 'Start kotlin app'
if: steps.should_run.outputs.run_ci_job == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -194,7 +172,6 @@ jobs:
adb install -r --no-incremental bazel-bin/test/kotlin/apps/baseline/hello_envoy_kt.apk
adb shell am start -n io.envoyproxy.envoymobile.helloenvoybaselinetest/.MainActivity
- name: 'Check connectivity'
if: steps.should_run.outputs.run_ci_job == 'true'
run: |
timeout 30 adb logcat -e "received headers with status 301" -m 1 || {
echo "Failed checking for headers in adb logcat" >&2
Expand All @@ -204,30 +181,24 @@ jobs:
exit 1
}
kotlinexperimentalapp:
if: github.repository == 'envoyproxy/envoy'
if: ${{ needs.env.outputs.mobile_android_build_all == 'true' }}
needs:
- env
- androidbuild
name: kotlin_experimental_app
needs: androidbuild
runs-on: macos-12
timeout-minutes: 50
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: should_run
name: 'Check whether to run'
run: ./mobile/tools/should_run_ci.sh
- uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2
if: steps.should_run.outputs.run_ci_job == 'true'
with:
java-version: '8'
java-package: jdk
architecture: x64
distribution: zulu
- name: 'Install dependencies'
if: steps.should_run.outputs.run_ci_job == 'true'
run: cd mobile && ./ci/mac_ci_setup.sh --android
- uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
if: steps.should_run.outputs.run_ci_job == 'true'
name: 'Start emulator'
with:
timeout_minutes: 10
Expand All @@ -237,7 +208,6 @@ jobs:
# ./bazelw mobile-install --fat_apk_cpu=x86_64 --start_app //examples/kotlin/hello_world:hello_envoy_kt
# When https://github.com/envoyproxy/envoy-mobile/issues/853 is fixed.
- name: 'Start kotlin app'
if: steps.should_run.outputs.run_ci_job == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -250,7 +220,6 @@ jobs:
adb install -r --no-incremental bazel-bin/test/kotlin/apps/experimental/hello_envoy_kt.apk
adb shell am start -n io.envoyproxy.envoymobile.helloenvoyexperimentaltest/.MainActivity
- name: 'Check connectivity'
if: steps.should_run.outputs.run_ci_job == 'true'
run: |
timeout 30 adb logcat -e "received headers with status 200" -m 1 || {
echo "Failed checking for headers in adb logcat" >&2
Expand Down