Skip to content

Commit

Permalink
ci/mobile: Set build images in one place (envoyproxy#27733)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax authored May 31, 2023
1 parent 702edcd commit 7e6031d
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 27 deletions.
49 changes: 35 additions & 14 deletions .github/workflows/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,48 @@ name: Environment
on:
workflow_call:
outputs:
build_image_ubuntu:
value: ${{ jobs.repo.outputs.build_image_ubuntu }}
build_image_ubuntu_mobile:
value: ${{ jobs.repo.outputs.build_image_ubuntu_mobile }}
mobile_android_build:
value: ${{ jobs.mobile.outputs.mobile_android_build }}
value: ${{ jobs.repo.outputs.mobile_android_build }}
mobile_android_build_all:
value: ${{ jobs.mobile.outputs.mobile_android_build_all }}
value: ${{ jobs.repo.outputs.mobile_android_build_all }}
mobile_android_tests:
value: ${{ jobs.mobile.outputs.mobile_android_tests }}
value: ${{ jobs.repo.outputs.mobile_android_tests }}
mobile_asan:
value: ${{ jobs.mobile.outputs.mobile_asan }}
value: ${{ jobs.repo.outputs.mobile_asan }}
mobile_cc_tests:
value: ${{ jobs.mobile.outputs.mobile_cc_tests }}
value: ${{ jobs.repo.outputs.mobile_cc_tests }}
mobile_compile_time_options:
value: ${{ jobs.mobile.outputs.mobile_compile_time_options }}
value: ${{ jobs.repo.outputs.mobile_compile_time_options }}
mobile_coverage:
value: ${{ jobs.mobile.outputs.mobile_coverage }}
value: ${{ jobs.repo.outputs.mobile_coverage }}
mobile_formatting:
value: ${{ jobs.mobile.outputs.mobile_formatting }}
value: ${{ jobs.repo.outputs.mobile_formatting }}
mobile_ios_build:
value: ${{ jobs.mobile.outputs.mobile_ios_build }}
value: ${{ jobs.repo.outputs.mobile_ios_build }}
mobile_ios_build_all:
value: ${{ jobs.mobile.outputs.mobile_ios_build_all }}
value: ${{ jobs.repo.outputs.mobile_ios_build_all }}
mobile_ios_tests:
value: ${{ jobs.mobile.outputs.mobile_ios_tests }}
value: ${{ jobs.repo.outputs.mobile_ios_tests }}
mobile_release_validation:
value: ${{ jobs.mobile.outputs.mobile_release_validation }}
value: ${{ jobs.repo.outputs.mobile_release_validation }}
mobile_tsan:
value: ${{ jobs.mobile.outputs.mobile_tsan }}
value: ${{ jobs.repo.outputs.mobile_tsan }}

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

jobs:
mobile:
repo:
if: github.repository == 'envoyproxy/envoy'
runs-on: ubuntu-20.04
outputs:
build_image_ubuntu: ${{ steps.build_image.outputs.build_image_ubuntu }}
build_image_ubuntu_mobile: ${{ steps.build_image.outputs.build_image_ubuntu_mobile }}
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 }}
Expand All @@ -58,6 +64,21 @@ jobs:
fetch-depth: 0
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy

- id: build_image
name: 'Check current build images'
run: |
{
echo "build_image_ubuntu=${BUILD_IMAGE_UBUNTU_REPO}:${BUILD_IMAGE_UBUNTU}@sha256:${BUILD_IMAGE_UBUNTU_SHA}"
echo "build_image_ubuntu_mobile=${BUILD_IMAGE_UBUNTU_REPO}:mobile-${BUILD_IMAGE_UBUNTU}@sha256:${BUILD_IMAGE_UBUNTU_MOBILE_SHA}"
} >> "$GITHUB_OUTPUT"
env:
# TODO(phlax): derive these from a config file
BUILD_IMAGE_UBUNTU_REPO: envoyproxy/envoy-build-ubuntu
BUILD_IMAGE_UBUNTU: 41c5a05d708972d703661b702a63ef5060125c33
BUILD_IMAGE_UBUNTU_SHA: 50337314a150ed12447c87c1622eac6f611a069888722fb9a426e21ed161cc26
BUILD_IMAGE_UBUNTU_MOBILE_SHA: ca26ff05bd3f3a09468242faaf38ae48315e57f0a87c102352162f95ac620e6f

- id: should_run
name: 'Check what to run'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile-android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 90
container:
image: envoyproxy/envoy-build-ubuntu:mobile-41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu_mobile }}
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile-android_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 90
container:
image: envoyproxy/envoy-build-ubuntu:mobile-41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu_mobile }}
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile-asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 180
container:
image: envoyproxy/envoy-build-ubuntu:mobile-41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu_mobile }}
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile-cc_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 120
container:
image: envoyproxy/envoy-build-ubuntu:41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu }}
steps:
- uses: actions/checkout@v3
- name: Add safe directory
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/mobile-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ concurrency:
cancel-in-progress: true

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

unittests:
if: ${{ github.repository == 'envoyproxy/envoy' }}
needs: env
name: unit_tests
runs-on: ubuntu-20.04
timeout-minutes: 120
container:
image: envoyproxy/envoy-build-ubuntu:41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu }}
steps:
- uses: actions/checkout@v3
- name: Ensure no listener leaks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run:
shell: bash
container:
image: envoyproxy/envoy-build-ubuntu:41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu }}
steps:
- uses: actions/checkout@v3
- name: Add safe directory
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/mobile-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ concurrency:
cancel-in-progress: true

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

docs:
if: ${{ github.repository == 'envoyproxy/envoy' }}
needs: env
runs-on: ubuntu-20.04
timeout-minutes: 20
container:
image: envoyproxy/envoy-build-ubuntu:41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu }}
steps:
- uses: actions/checkout@v3
- name: Add safe directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 45
container:
image: envoyproxy/envoy-build-ubuntu:41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu }}
env:
CLANG_FORMAT: /opt/llvm/bin/clang-format
BUILDIFIER_BIN: /usr/local/bin/buildifier
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/mobile-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 120
container:
image: envoyproxy/envoy-build-ubuntu:41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu }}
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 90
container:
image: envoyproxy/envoy-build-ubuntu:41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu }}
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 30
container:
image: envoyproxy/envoy-build-ubuntu:41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu }}
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile-tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 90
container:
image: envoyproxy/envoy-build-ubuntu:mobile-41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu_mobile }}
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 120
container:
image: envoyproxy/envoy-build-ubuntu:mobile-41c5a05d708972d703661b702a63ef5060125c33
image: ${{ needs.env.outputs.build_image_ubuntu_mobile }}
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
Expand Down

0 comments on commit 7e6031d

Please sign in to comment.