forked from youtube/cobalt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I8cdee8601afb395143555c579f9c7ba79c8de9f4
- Loading branch information
1 parent
fd65e24
commit e6d64bf
Showing
2 changed files
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,11 @@ jobs: | |
run: | | ||
includes=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -c '.includes') | ||
echo "includes=${includes}" >> $GITHUB_ENV | ||
- id: set-on-device-test-attempts | ||
shell: bash | ||
run: | | ||
on_device_test_attempts=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.on_device_test.test_attempts // empty') | ||
echo "on_device_test_attempts=${on_device_test_attempts}" >> $GITHUB_ENV | ||
- id: set-on-device-test | ||
shell: bash | ||
run: | | ||
|
@@ -121,6 +126,7 @@ jobs: | |
platforms: ${{ env.platforms }} | ||
includes: ${{ env.includes }} | ||
on_device_test: ${{ env.on_device_test }} | ||
on_device_test_attempts: ${{ env.on_device_test_attempts }} | ||
on_host_test: ${{ env.on_host_test }} | ||
on_host_test_shards: ${{ env.on_host_test_shards }} | ||
docker_service: ${{ env.docker_service }} | ||
|
@@ -187,6 +193,43 @@ jobs: | |
type: onhost | ||
os: windows | ||
|
||
# Runs on-device integration and unit tests. | ||
on-device-test: | ||
needs: [initialize, build] | ||
# 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: | | ||
fromJSON(needs.initialize.outputs.on_device_test).enabled == 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: ${{ matrix.name }}_on_device_${{ matrix.shard }} | ||
container: ${{ needs.docker-unittest-image.outputs.docker_unittest_tag }} | ||
permissions: {} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: ${{ fromJson(needs.initialize.outputs.platforms) }} | ||
config: [devel] | ||
shard: ${{ fromJson(needs.initialize.outputs.on_device_test).tests }} | ||
include: ${{ fromJson(needs.initialize.outputs.includes) }} | ||
env: | ||
COBALT_BOOTLOADER: ${{ needs.initialize.outputs.bootloader }} | ||
ON_DEVICE_TEST_ATTEMPTS: ${{ needs.initialize.outputs.on_device_test_attempts }} | ||
MODULAR_BUILD: ${{ inputs.modular && 1 || 0 }} | ||
steps: | ||
- name: Checkout | ||
uses: kaidokert/[email protected] | ||
timeout-minutes: 30 | ||
with: | ||
fetch-depth: 1 | ||
persist-credentials: false | ||
- name: Run Tests (${{ matrix.shard }}) | ||
uses: ./.github/actions/on_device_tests | ||
|
||
# Runs on the host unit and integration tests. | ||
on-host-test: | ||
needs: [initialize, build] | ||
|