-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Refer to the original PR: #2777 Reorder GitHub workflow steps so that Upload Nightly Artifacts occurs after Build Bootloader is potentionally run so that the upload includes the bootloaders. b/323963204 --------- Co-authored-by: Brian Ting <[email protected]> (cherry picked from commit 73a025c)
- Loading branch information
1 parent
c7db382
commit d6b515d
Showing
9 changed files
with
210 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: On Device Test | ||
description: Runs on-device tests. | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install requirements | ||
run: | | ||
pip3 install grpcio==1.38.0 grpcio-tools==1.38.0 | ||
shell: bash | ||
- name: Generate gRPC files | ||
run: | | ||
python -m grpc_tools.protoc -Itools/ --python_out=tools/ --grpc_python_out=tools/ tools/on_device_tests_gateway.proto | ||
shell: bash | ||
- name: Set up Cloud SDK | ||
uses: isarkis/setup-gcloud@40dce7857b354839efac498d3632050f568090b6 # v1.1.1 | ||
- name: Set env vars | ||
env: | ||
WORKFLOW: ${{ github.workflow }} | ||
run: | | ||
echo "PROJECT_NAME=$(gcloud config get-value project)" >> $GITHUB_ENV | ||
echo "GITHUB_RUN_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV | ||
echo "WORKFLOW=${WORKFLOW}" >> $GITHUB_ENV | ||
# Boot loader env | ||
if [ "${COBALT_EVERGREEN_LOADER}" != "null" ]; then | ||
echo "LOADER_CONFIG=${{ matrix.config }}" >> $GITHUB_ENV | ||
echo "LOADER_PLATFORM=${COBALT_EVERGREEN_LOADER}" >> $GITHUB_ENV | ||
fi | ||
# Dimension env | ||
if [ "${{ matrix.dimension }}" != "null" ]; then | ||
echo "DIMENSION=${{ matrix.dimension }}" >> $GITHUB_ENV | ||
fi | ||
# Shard env | ||
if [[ "${{matrix.shard}}" == 'black_box_test' || "${{matrix.shard}}" == 'evergreen_test' || "${{matrix.shard}}" == 'unit_test' ]]; then | ||
echo "SHARD_NAME=${{ matrix.shard }}" >> $GITHUB_ENV | ||
echo "TEST_TYPE=${{ matrix.shard }}" >> $GITHUB_ENV | ||
else | ||
echo "SHARD_NAME=unit_test_${{ matrix.shard }}" >> $GITHUB_ENV | ||
echo "TEST_TYPE=unit_test" >> $GITHUB_ENV | ||
echo "USE_SHARDING=1" >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
- name: run ${{ env.SHARD_NAME }} tests on ${{ matrix.platform }} platform | ||
env: | ||
GITHUB_SHA: ${{ github.sha }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
GITHUB_EVENT_NAME: ${{ github.event_name }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TRIGGERING_ACTOR: ${{ github.triggering_actor }} | ||
GITHUB_ACTOR_ID: ${{ github.actor_id }} | ||
GITHUB_REPO: ${{ github.repository }} | ||
GITHUB_PR_HEAD_USER_LOGIN: ${{ github.event.pull_request.head.user.login }} | ||
GITHUB_PR_HEAD_USER_ID: ${{ github.event.pull_request.head.user.id }} | ||
GITHUB_COMMIT_AUTHOR_USERNAME: ${{ github.event.commits[0].author.username }} | ||
GITHUB_COMMIT_AUTHOR_EMAIL: ${{ github.event.commits[0].author.email }} | ||
run: | | ||
set -uxe | ||
python3 tools/on_device_tests_gateway_client.py \ | ||
--token ${GITHUB_TOKEN} \ | ||
--change_id "${GITHUB_PR_HEAD_SHA:-$GITHUB_SHA}" \ | ||
trigger \ | ||
--test_type ${{ env.TEST_TYPE }} \ | ||
--platform ${{ matrix.target_platform }} \ | ||
--config ${{ matrix.config }} \ | ||
--tag cobalt_github_${GITHUB_EVENT_NAME} \ | ||
--builder_name github_${{ matrix.platform }}_tests \ | ||
--build_number ${GITHUB_RUN_NUMBER} \ | ||
${LOADER_PLATFORM:+"--loader_config" "$LOADER_CONFIG"} \ | ||
${LOADER_PLATFORM:+"--loader_platform" "$LOADER_PLATFORM"} \ | ||
${DIMENSION:+"--dimension" "$DIMENSION"} \ | ||
${USE_SHARDING:+"--unittest_shard_index" "${{ matrix.shard }}"} \ | ||
${ON_DEVICE_TEST_ATTEMPTS:+"--test_attempts" "$ON_DEVICE_TEST_ATTEMPTS"} \ | ||
--archive_path gs://${PROJECT_NAME}-test-artifacts/${WORKFLOW}/${GITHUB_RUN_NUMBER}/${{ matrix.platform }}_${{ matrix.config }}/artifacts.tar \ | ||
--label github \ | ||
--label ${GITHUB_EVENT_NAME} \ | ||
--label ${WORKFLOW} \ | ||
--label actor-${GITHUB_ACTOR} \ | ||
--label actor_id-${GITHUB_ACTOR_ID} \ | ||
--label triggering_actor-${GITHUB_TRIGGERING_ACTOR} \ | ||
--label sha-${GITHUB_SHA} \ | ||
--label repository-${GITHUB_REPO} \ | ||
--label author-${GITHUB_PR_HEAD_USER_LOGIN:-$GITHUB_COMMIT_AUTHOR_USERNAME} \ | ||
--label author_id-${GITHUB_PR_HEAD_USER_ID:-$GITHUB_COMMIT_AUTHOR_EMAIL} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.