Skip to content

Commit

Permalink
Cherry pick PR #2328: Adapt ODT action to new service (#2330)
Browse files Browse the repository at this point in the history
Refer to the original PR: youtube/cobalt#2328

New service maintains a persistant connection.

b/311260244

---------

Co-authored-by: Oscar Vestlie <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and oxve committed Jan 30, 2024
1 parent 0a20cab commit 3bf0597
Showing 1 changed file with 24 additions and 33 deletions.
57 changes: 24 additions & 33 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,41 +210,32 @@ jobs:
id: on_device_test
run: |
set -eux
SESSION_ID=$(
python3 tools/on_device_tests_gateway_client.py \
--token ${{ github.token }} \
--change_id "${{ github.sha }}" \
trigger \
--test_type ${{ matrix.type }} \
--platform ${{ matrix.platform }} \
--config ${{ matrix.config }} \
--tag cobalt_github_${{ github.event_name }} \
--builder_name github_${{ matrix.platform }}_tests \
--build_number ${GITHUB_RUN_NUMBER} \
--version '22.lts.1+' \
${LOADER_PLATFORM:+"--loader_config" "$LOADER_CONFIG"} \
${LOADER_PLATFORM:+"--loader_platform" "$LOADER_PLATFORM"} \
${DIMENSION:+"--dimension" "$DIMENSION"} \
--archive_path gs://${PROJECT_NAME}-test-artifacts/${WORKFLOW}/${GITHUB_RUN_NUMBER}/${{ matrix.platform }}_${{ matrix.config }}/artifacts.tar \
--label github \
--label ${{ github.event_name }} \
--label ${{ github.workflow }} \
--label actor-${{ github.actor }} \
--label actor_id-${{ github.actor_id }} \
--label triggering_actor-${{ github.triggering_actor }} \
--label sha-${{ github.sha }} \
--label repository-${{ github.repository }} \
--label author-${{ github.event.pull_request.head.user.login || github.event.commits[0].author.username }} \
--label author_id-${{ github.event.pull_request.head.user.id || github.event.commits[0].author.email }}
)
echo "SESSION_ID=$SESSION_ID" >> $GITHUB_ENV
shell: bash
- name: watch ${{ matrix.type }} tests on ${{ matrix.platform }} platform
run: |
python3 tools/on_device_tests_gateway_client.py \
--token ${{ github.token }} \
--change_id "${{ github.sha }}" \
watch ${{ env.SESSION_ID }}
trigger \
--test_type ${{ matrix.type }} \
--platform ${{ matrix.platform }} \
--config ${{ matrix.config }} \
--tag cobalt_github_${{ github.event_name }} \
--builder_name github_${{ matrix.platform }}_tests \
--build_number ${GITHUB_RUN_NUMBER} \
--version '22.lts.1+' \
${LOADER_PLATFORM:+"--loader_config" "$LOADER_CONFIG"} \
${LOADER_PLATFORM:+"--loader_platform" "$LOADER_PLATFORM"} \
${DIMENSION:+"--dimension" "$DIMENSION"} \
--archive_path gs://${PROJECT_NAME}-test-artifacts/${WORKFLOW}/${GITHUB_RUN_NUMBER}/${{ matrix.platform }}_${{ matrix.config }}/artifacts.tar \
--label github \
--label ${{ github.event_name }} \
--label ${{ github.workflow }} \
--label actor-${{ github.actor }} \
--label actor_id-${{ github.actor_id }} \
--label triggering_actor-${{ github.triggering_actor }} \
--label sha-${{ github.sha }} \
--label repository-${{ github.repository }} \
--label author-${{ github.event.pull_request.head.user.login || github.event.commits[0].author.username }} \
--label author_id-${{ github.event.pull_request.head.user.id || github.event.commits[0].author.email }}
shell: bash

# Runs builds.
build:
Expand Down Expand Up @@ -277,7 +268,7 @@ jobs:
uses: ./.github/actions/upload_test_artifacts
with:
type: onhost
# Build bootloader if neccessary.
# Build bootloader if necessary.
- name: Set bootloader config
if: ${{ needs.initialize.outputs.bootloader != 'null' && matrix.config == 'devel' }}
run: echo "COBALT_BOOTLOADER=${{needs.initialize.outputs.bootloader}}" >> $GITHUB_ENV
Expand Down

0 comments on commit 3bf0597

Please sign in to comment.