Skip to content

Commit

Permalink
Testing ODT trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
isarkis committed Jan 19, 2025
1 parent d0f748f commit 66b94a5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/actions/on_device_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ runs:
--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}
--label author_id-${GITHUB_PR_HEAD_USER_ID:-$GITHUB_COMMIT_AUTHOR_EMAIL} \
${DIMENSION:+"--dimension" "$DIMENSION"} \
${ON_DEVICE_TEST_ATTEMPTS:+"--test_attempts" "$ON_DEVICE_TEST_ATTEMPTS"} \
--gcs_archive_path "${GCS_ARTIFACTS_PATH}" \
Expand Down
27 changes: 24 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,28 @@ jobs:
gtest_shards: ${{ env.gtest_shards }}
test_on_host: ${{ env.test_on_host }}
test_on_device: ${{ env.test_on_device }}

# Runs on-device integration and unit tests.
foo:
needs: [initialize]
# Run ODT when on_device label is applied on PR.
# Also, run ODT on push and schedule if not explicitly disabled via repo vars.
if: needs.initialize.outputs.test_on_device == 'true' &&
((
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'on_device') ) || ((
inputs.nightly == 'true' || github.event_name == 'schedule') &&
vars.RUN_ODT_TESTS_ON_NIGHTLY != 'False') ||
( github.event_name == 'push' && vars.RUN_ODT_TESTS_ON_POSTSUBMIT != 'False'
))
runs-on: [self-hosted, odt-runner]
name: foobar
permissions: {}
steps:
- name: Test
id: set-docker-tag-output
shell: bash
run: echo "HELLO WORLD"

# Builds, tags, and pushes Cobalt docker build images to ghr.
docker-build-image:
needs: [initialize]
Expand Down Expand Up @@ -288,12 +309,12 @@ jobs:
# Run ODT when on_device label is applied on PR.
# Also, run ODT on push and schedule if not explicitly disabled via repo vars.
if: |
${{ needs.initialize.outputs.test_on_device == 'true' && ((
needs.initialize.outputs.test_on_device == 'true' && ((
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'on_device') ) || ((
inputs.nightly == 'true' || github.event_name == 'schedule') &&
vars.RUN_ODT_TESTS_ON_NIGHTLY != 'False') ||
( github.event_name == 'push' && vars.RUN_ODT_TESTS_ON_POSTSUBMIT != 'False' ) ) }}
( github.event_name == 'push' && vars.RUN_ODT_TESTS_ON_POSTSUBMIT != 'False' ) )
runs-on: [self-hosted, odt-runner]
name: ${{ matrix.name }}_on_device
permissions: {}
Expand Down

0 comments on commit 66b94a5

Please sign in to comment.