From e5b9394ed04573f18efe98b20f840cd8ce1eebfb Mon Sep 17 00:00:00 2001 From: Oscar Vestlie Date: Sun, 29 Dec 2024 21:47:55 +0000 Subject: [PATCH] Make root target configurable per platform --- .github/actions/build/action.yaml | 5 ++++- .github/config/chromium_linux.json | 1 + .github/config/linux.json | 1 + .github/workflows/main.yaml | 7 +++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/actions/build/action.yaml b/.github/actions/build/action.yaml index 32b5d5d43d32..cd60ee1c392e 100644 --- a/.github/actions/build/action.yaml +++ b/.github/actions/build/action.yaml @@ -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 @@ -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 diff --git a/.github/config/chromium_linux.json b/.github/config/chromium_linux.json index 90b2df92bfbf..bd5fa86ca2cf 100644 --- a/.github/config/chromium_linux.json +++ b/.github/config/chromium_linux.json @@ -3,6 +3,7 @@ "platforms": [ "chromium_linux-x64x11" ], + "test_root_target": "//content/shell:content_shell", "test_on_host": true, "targets": [ "content_shell" diff --git a/.github/config/linux.json b/.github/config/linux.json index 059984dca42b..19b74dfd13fe 100644 --- a/.github/config/linux.json +++ b/.github/config/linux.json @@ -1,5 +1,6 @@ { "docker_service": "linux", + "test_root_target": "//cobalt:cobalt", "test_on_host": true, "platforms": [ "linux-x64x11" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1c907ba578be..cb1d30e2df37 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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: | @@ -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 }} @@ -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 }}