Skip to content

Commit

Permalink
Make root target configurable per platform
Browse files Browse the repository at this point in the history
  • Loading branch information
oxve committed Dec 29, 2024
1 parent efbb05d commit e5b9394
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
targets:
description: "List of ninja targets for Cobalt build."
required: true
test_root_target:
description: "The root target from which to deduce what tests to run."
required: true
upload_on_host_test_artifacts:
description: "Indicates if on-host test artifacts should be uploaded."
required: true
Expand Down Expand Up @@ -50,7 +53,7 @@ runs:
- name: Calculate test targets
if: inputs.upload_on_host_test_artifacts == 'true' || inputs.upload_on_device_test_artifacts == 'true'
env:
ROOT_TARGET: //url:url_unittests
ROOT_TARGET: ${{ inputs.test_root_target }}
TEST_TARGETS_JSON_FILE: test_targets.json
run: |
set -x
Expand Down
1 change: 1 addition & 0 deletions .github/config/chromium_linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"platforms": [
"chromium_linux-x64x11"
],
"test_root_target": "//content/shell:content_shell",
"test_on_host": true,
"targets": [
"content_shell"
Expand Down
1 change: 1 addition & 0 deletions .github/config/linux.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"docker_service": "linux",
"test_root_target": "//cobalt:cobalt",
"test_on_host": true,
"platforms": [
"linux-x64x11"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ jobs:
run: |
includes=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -c '.includes')
echo "includes=${includes}" >> $GITHUB_ENV
- id: set-test-root-target
shell: bash
run: |
test_root_target=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.test_root_target')
echo "test_root_target=${test_root_target}" >> $GITHUB_ENV
- id: set-test-on-host
shell: bash
run: |
Expand All @@ -90,6 +95,7 @@ jobs:
targets: ${{ env.targets }}
includes: ${{ env.includes }}
docker_service: ${{ env.docker_service }}
test_root_target: ${{ env.test_root_target }}
test_on_host: ${{ env.test_on_host }}
test_on_device: ${{ env.test_on_device }}

Expand Down Expand Up @@ -168,6 +174,7 @@ jobs:
with:
targets: ${{ needs.initialize.outputs.targets }}
test_artifacts_key: ${{ env.TEST_ARTIFACTS_KEY }}
test_root_target: ${{ needs.initialize.outputs.test_root_target }}
upload_on_host_test_artifacts: ${{ matrix.config == 'devel' && needs.initialize.outputs.test_on_host }}
upload_on_device_test_artifacts: ${{ matrix.config == 'devel' && needs.initialize.outputs.test_on_device }}

Expand Down

0 comments on commit e5b9394

Please sign in to comment.