Skip to content

Commit

Permalink
Add xb1_test builders
Browse files Browse the repository at this point in the history
Change-Id: I8cdee8601afb395143555c579f9c7ba79c8de9f4
  • Loading branch information
niranjanyardi committed Feb 12, 2024
1 parent fd65e24 commit e6d64bf
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/config/xb1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
"__comment" : "TODO: Deploy a runner and change this",
"docker_runner_service": "runner-xb1",
"runner_tag": "xb1",
"on_device_test": {
"enabled": true,
"tests": [
"0",
"1",
"2",
"3"
]
}
"platforms": [
"xb1"
],
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/main_win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit e6d64bf

Please sign in to comment.