Skip to content

Commit

Permalink
Cherry pick PR #2777: Reorder GitHub workflow steps. (#2782)
Browse files Browse the repository at this point in the history
Refer to the original PR: #2777

Reorder GitHub workflow steps so that Upload Nightly Artifacts occurs
after Build Bootloader is potentionally run so that the upload includes
the bootloaders.

b/323963204

---------

Co-authored-by: Brian Ting <[email protected]>
(cherry picked from commit 73a025c)
  • Loading branch information
cobalt-github-releaser-bot authored and anonymous1-me committed Mar 30, 2024
1 parent c7db382 commit d6b515d
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 20 deletions.
7 changes: 6 additions & 1 deletion .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@ runs:
run: |
set -x
env
if [ -z ${COBALT_BOOTLOADER+x} ]; then
if [ -z ${COBALT_EVERGREEN_LOADER+x} ]; then
BUILD_PLATFORM=${{ matrix.target_platform }}
BUILD_TARGET=all
if [[ "${{matrix.config}}" =~ ^(qa|gold)$ ]]; then
BUILD_TARGET=default
fi
else
<<<<<<< HEAD
BUILD_PLATFORM=${COBALT_BOOTLOADER}
BUILD_TARGET='loader_app_install elf_loader_sandbox_install crashpad_handler_install'
=======
BUILD_PLATFORM=${COBALT_EVERGREEN_LOADER}
BUILD_TARGET='loader_app_install elf_loader_sandbox_install native_target/crashpad_handler'
>>>>>>> 73a025ce5d8 (Cherry pick PR #2777: Reorder GitHub workflow steps. (#2782))
fi
# GitHub Runners have home set to /github/home.
if [ -d /root/starboard-toolchains ]; then
Expand Down
13 changes: 13 additions & 0 deletions .github/actions/gn/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,25 @@ runs:
- name: GN
run: |
set -x
<<<<<<< HEAD
if [ -z ${COBALT_BOOTLOADER+x} ]; then
=======
extra_arguments="${{matrix.extra_gn_arguments}}"
if [ -z ${COBALT_EVERGREEN_LOADER+x} ]; then
>>>>>>> 73a025ce5d8 (Cherry pick PR #2777: Reorder GitHub workflow steps. (#2782))
BUILD_PLATFORM=${{ matrix.target_platform }}
EXTRA_GN_ARGUMENTS=${{ matrix.extra_gn_arguments }}
else
<<<<<<< HEAD
BUILD_PLATFORM=${COBALT_BOOTLOADER}
EXTRA_GN_ARGUMENTS=${{ matrix.extra_bootloader_gn_arguments }}
=======
BUILD_PLATFORM=${COBALT_EVERGREEN_LOADER}
if [ ! -z "${{matrix.evergreen_loader_extra_gn_arguments}}" ]
then
extra_arguments="${{matrix.evergreen_loader_extra_gn_arguments}}"
fi
>>>>>>> 73a025ce5d8 (Cherry pick PR #2777: Reorder GitHub workflow steps. (#2782))
fi
gn gen $GITHUB_WORKSPACE/out/${BUILD_PLATFORM}_${{matrix.config}} --args="target_platform=\"${BUILD_PLATFORM}\" ${{matrix.sb_api_version}} ${{matrix.target_os}} ${{matrix.target_cpu}} ${EXTRA_GN_ARGUMENTS} is_internal_build=false build_type=\"${{matrix.config}}\""
gn check $GITHUB_WORKSPACE/out/${BUILD_PLATFORM}_${{ matrix.config }}
Expand Down
88 changes: 88 additions & 0 deletions .github/actions/on_device_tests/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: On Device Test
description: Runs on-device tests.

runs:
using: "composite"
steps:
- name: Install requirements
run: |
pip3 install grpcio==1.38.0 grpcio-tools==1.38.0
shell: bash
- name: Generate gRPC files
run: |
python -m grpc_tools.protoc -Itools/ --python_out=tools/ --grpc_python_out=tools/ tools/on_device_tests_gateway.proto
shell: bash
- name: Set up Cloud SDK
uses: isarkis/setup-gcloud@40dce7857b354839efac498d3632050f568090b6 # v1.1.1
- name: Set env vars
env:
WORKFLOW: ${{ github.workflow }}
run: |
echo "PROJECT_NAME=$(gcloud config get-value project)" >> $GITHUB_ENV
echo "GITHUB_RUN_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
echo "WORKFLOW=${WORKFLOW}" >> $GITHUB_ENV
# Boot loader env
if [ "${COBALT_EVERGREEN_LOADER}" != "null" ]; then
echo "LOADER_CONFIG=${{ matrix.config }}" >> $GITHUB_ENV
echo "LOADER_PLATFORM=${COBALT_EVERGREEN_LOADER}" >> $GITHUB_ENV
fi
# Dimension env
if [ "${{ matrix.dimension }}" != "null" ]; then
echo "DIMENSION=${{ matrix.dimension }}" >> $GITHUB_ENV
fi
# Shard env
if [[ "${{matrix.shard}}" == 'black_box_test' || "${{matrix.shard}}" == 'evergreen_test' || "${{matrix.shard}}" == 'unit_test' ]]; then
echo "SHARD_NAME=${{ matrix.shard }}" >> $GITHUB_ENV
echo "TEST_TYPE=${{ matrix.shard }}" >> $GITHUB_ENV
else
echo "SHARD_NAME=unit_test_${{ matrix.shard }}" >> $GITHUB_ENV
echo "TEST_TYPE=unit_test" >> $GITHUB_ENV
echo "USE_SHARDING=1" >> $GITHUB_ENV
fi
shell: bash
- name: run ${{ env.SHARD_NAME }} tests on ${{ matrix.platform }} platform
env:
GITHUB_SHA: ${{ github.sha }}
GITHUB_TOKEN: ${{ github.token }}
GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TRIGGERING_ACTOR: ${{ github.triggering_actor }}
GITHUB_ACTOR_ID: ${{ github.actor_id }}
GITHUB_REPO: ${{ github.repository }}
GITHUB_PR_HEAD_USER_LOGIN: ${{ github.event.pull_request.head.user.login }}
GITHUB_PR_HEAD_USER_ID: ${{ github.event.pull_request.head.user.id }}
GITHUB_COMMIT_AUTHOR_USERNAME: ${{ github.event.commits[0].author.username }}
GITHUB_COMMIT_AUTHOR_EMAIL: ${{ github.event.commits[0].author.email }}
run: |
set -uxe
python3 tools/on_device_tests_gateway_client.py \
--token ${GITHUB_TOKEN} \
--change_id "${GITHUB_PR_HEAD_SHA:-$GITHUB_SHA}" \
trigger \
--test_type ${{ env.TEST_TYPE }} \
--platform ${{ matrix.target_platform }} \
--config ${{ matrix.config }} \
--tag cobalt_github_${GITHUB_EVENT_NAME} \
--builder_name github_${{ matrix.platform }}_tests \
--build_number ${GITHUB_RUN_NUMBER} \
${LOADER_PLATFORM:+"--loader_config" "$LOADER_CONFIG"} \
${LOADER_PLATFORM:+"--loader_platform" "$LOADER_PLATFORM"} \
${DIMENSION:+"--dimension" "$DIMENSION"} \
${USE_SHARDING:+"--unittest_shard_index" "${{ matrix.shard }}"} \
${ON_DEVICE_TEST_ATTEMPTS:+"--test_attempts" "$ON_DEVICE_TEST_ATTEMPTS"} \
--archive_path gs://${PROJECT_NAME}-test-artifacts/${WORKFLOW}/${GITHUB_RUN_NUMBER}/${{ matrix.platform }}_${{ matrix.config }}/artifacts.tar \
--label github \
--label ${GITHUB_EVENT_NAME} \
--label ${WORKFLOW} \
--label actor-${GITHUB_ACTOR} \
--label actor_id-${GITHUB_ACTOR_ID} \
--label triggering_actor-${GITHUB_TRIGGERING_ACTOR} \
--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}
shell: bash
16 changes: 8 additions & 8 deletions .github/actions/on_host_test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ runs:
fi
python3 ${GITHUB_WORKSPACE}/tools/create_archive.py -x -s ${GITHUB_WORKSPACE}/out/tmp/${{matrix.platform}}_${{matrix.config}}.${ARCHIVE_EXTENSION} -d ${GITHUB_WORKSPACE}/out ${parallel}
rm -rf ${GITHUB_WORKSPACE}/out/tmp
- name: Download Bootloader Archive
if: ${{ env.COBALT_BOOTLOADER != null && env.COBALT_BOOTLOADER != 'null' }}
- name: Download Evergreen loader Archive
if: ${{ env.COBALT_EVERGREEN_LOADER != null && env.COBALT_EVERGREEN_LOADER != 'null' }}
shell: bash
env:
WORKFLOW: ${{ github.workflow }}
run: |
set -x
PROJECT_NAME=$(gcloud config get-value project)
gsutil cp gs://${PROJECT_NAME}-test-artifacts/${WORKFLOW}/${GITHUB_RUN_NUMBER}/${{matrix.platform}}_${{matrix.config}}/${COBALT_BOOTLOADER}_${{matrix.config}}.${ARCHIVE_EXTENSION} ${GITHUB_WORKSPACE}/out/tmp/${COBALT_BOOTLOADER}_${{matrix.config}}.${ARCHIVE_EXTENSION}
- name: Extract Bootloader Archive
if: ${{ env.COBALT_BOOTLOADER != null && env.COBALT_BOOTLOADER != 'null' }}
gsutil cp gs://${PROJECT_NAME}-test-artifacts/${WORKFLOW}/${GITHUB_RUN_NUMBER}/${{matrix.platform}}_${{matrix.config}}/${COBALT_EVERGREEN_LOADER}_${{matrix.config}}.${ARCHIVE_EXTENSION} ${GITHUB_WORKSPACE}/out/tmp/${COBALT_EVERGREEN_LOADER}_${{matrix.config}}.${ARCHIVE_EXTENSION}
- name: Extract Evergreen loader Archive
if: ${{ env.COBALT_EVERGREEN_LOADER != null && env.COBALT_EVERGREEN_LOADER != 'null' }}
shell: bash
run: |
set -x
python3 ${GITHUB_WORKSPACE}/tools/create_archive.py -x -s ${GITHUB_WORKSPACE}/out/tmp/${COBALT_BOOTLOADER}_${{matrix.config}}.${ARCHIVE_EXTENSION} -d ${GITHUB_WORKSPACE}/out --parallel
python3 ${GITHUB_WORKSPACE}/tools/create_archive.py -x -s ${GITHUB_WORKSPACE}/out/tmp/${COBALT_EVERGREEN_LOADER}_${{matrix.config}}.${ARCHIVE_EXTENSION} -d ${GITHUB_WORKSPACE}/out --parallel
rm -rf ${GITHUB_WORKSPACE}/out/tmp
- name: Set Env Variables
shell: bash
Expand All @@ -64,8 +64,8 @@ runs:
run: |
set -x
loader_args=''
if [ "${COBALT_BOOTLOADER}" != "null" ]; then
loader_args="--loader_platform ${COBALT_BOOTLOADER} --loader_config ${{matrix.config}}"
if [ "${COBALT_EVERGREEN_LOADER}" != "null" ]; then
loader_args="--loader_platform ${COBALT_EVERGREEN_LOADER} --loader_config ${{matrix.config}}"
fi
if [[ "${{matrix.shard}}" == 'integration' ]]; then
xvfb-run -a --server-args="-screen 0 1920x1080x24i +render +extension GLX -noreset" python3 $GITHUB_WORKSPACE/cobalt/black_box_tests/black_box_tests.py --platform ${{matrix.target_platform}} --config ${{matrix.config}} ${loader_args}
Expand Down
10 changes: 5 additions & 5 deletions .github/actions/upload_test_artifacts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ runs:
run: |
set -x
project_name=$(gcloud config get-value project)
if [ -z ${COBALT_BOOTLOADER+x} ]
if [ -z ${COBALT_EVERGREEN_LOADER+x} ]
then
PLATFORM=${{matrix.platform}}
echo "TARGET_PLATFORM=${{matrix.target_platform}}" >> $GITHUB_ENV
else
PLATFORM=${COBALT_BOOTLOADER}
echo "TARGET_PLATFORM=${COBALT_BOOTLOADER}" >> $GITHUB_ENV
PLATFORM=${COBALT_EVERGREEN_LOADER}
echo "TARGET_PLATFORM=${COBALT_EVERGREEN_LOADER}" >> $GITHUB_ENV
fi
if [ "${{ inputs.type }}" == 'ondevice' ]
Expand Down Expand Up @@ -55,9 +55,9 @@ runs:
if [ "${{ inputs.type }}" == 'ondevice' ]
then
outdir="$GITHUB_WORKSPACE/out/${{matrix.target_platform}}_${{matrix.config}}"
if [ -n "${COBALT_BOOTLOADER}" ]
if [ -n "${COBALT_EVERGREEN_LOADER}" ]
then
outdir="${outdir} $GITHUB_WORKSPACE/out/${COBALT_BOOTLOADER}_${{matrix.config}}"
outdir="${outdir} $GITHUB_WORKSPACE/out/${COBALT_EVERGREEN_LOADER}_${{matrix.config}}"
fi
python3 $GITHUB_WORKSPACE/tools/create_archive.py --test_infra -d ${{env.ARCHIVE_FILE}} -s ${outdir}
elif [ "${{ inputs.type }}" == 'onhost' ]
Expand Down
26 changes: 25 additions & 1 deletion .github/config/evergreen-arm-hardfp.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"docker_service": "build-raspi",
"bootloader": "raspi-2",
"evergreen_loader": "raspi-2",
"on_device_test": {
"enabled": true,
"tests": [
Expand All @@ -20,7 +20,21 @@
"target_platform":"evergreen-arm-hardfp",
"target_cpu":"target_cpu=\\\"arm\\\"",
"extra_gn_arguments":"use_asan=false",
<<<<<<< HEAD
"extra_bootloader_gn_arguments":"is_clang=false",
=======
"evergreen_loader_extra_gn_arguments": "use_asan=false is_clang=false",
"dimension": "release_version=regex:10.*"
},
{
"name":"sbversion-15",
"platform":"evergreen-arm-hardfp-sbversion-15",
"target_platform":"evergreen-arm-hardfp",
"target_cpu":"target_cpu=\\\"arm\\\"",
"extra_gn_arguments":"use_asan=false",
"evergreen_loader_extra_gn_arguments":"use_asan=false is_clang=false",
"sb_api_version": "sb_api_version=15",
>>>>>>> 73a025ce5d8 (Cherry pick PR #2777: Reorder GitHub workflow steps. (#2782))
"dimension": "release_version=regex:10.*"
},
{
Expand All @@ -29,8 +43,13 @@
"target_platform":"evergreen-arm-hardfp",
"target_cpu":"target_cpu=\\\"arm\\\"",
"extra_gn_arguments":"use_asan=false",
<<<<<<< HEAD
"extra_bootloader_gn_arguments":"is_clang=false",
"sb_api_version":"sb_api_version=14",
=======
"evergreen_loader_extra_gn_arguments":"use_asan=false is_clang=false",
"sb_api_version": "sb_api_version=14",
>>>>>>> 73a025ce5d8 (Cherry pick PR #2777: Reorder GitHub workflow steps. (#2782))
"dimension": "release_version=regex:10.*"
},
{
Expand All @@ -39,6 +58,7 @@
"target_platform":"evergreen-arm-hardfp",
"target_cpu":"target_cpu=\\\"arm\\\"",
"extra_gn_arguments":"use_asan=false",
<<<<<<< HEAD
"extra_bootloader_gn_arguments":"is_clang=false",
"sb_api_version":"sb_api_version=13",
"dimension": "release_version=regex:10.*"
Expand All @@ -51,6 +71,10 @@
"extra_gn_arguments":"use_asan=false",
"extra_bootloader_gn_arguments":"is_clang=false",
"sb_api_version":"sb_api_version=12",
=======
"evergreen_loader_extra_gn_arguments":"use_asan=false is_clang=false",
"sb_api_version": "sb_api_version=13",
>>>>>>> 73a025ce5d8 (Cherry pick PR #2777: Reorder GitHub workflow steps. (#2782))
"dimension": "release_version=regex:10.*"
}
]
Expand Down
6 changes: 6 additions & 0 deletions .github/config/evergreen-x64.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"docker_service": "build-linux-evergreen",
<<<<<<< HEAD
"on_host_test": "true",
"bootloader": "linux-x64x11",
"on_host_test_shards": ["0", "1", "2", "3", "integration"],
=======
"on_host_test": true,
"evergreen_loader": "linux-x64x11",
"on_host_test_shards": ["0", "1", "2", "3", "blackbox", "wpt"],
>>>>>>> 73a025ce5d8 (Cherry pick PR #2777: Reorder GitHub workflow steps. (#2782))
"platforms": [
"evergreen-x64",
"evergreen-x64-sbversion-14",
Expand Down
6 changes: 6 additions & 0 deletions .github/config/linux.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"docker_service": "build-linux",
<<<<<<< HEAD
"bootloader": "linux-x64x11",
"on_host_test": "true",
"on_host_test_shards": ["0", "1", "2", "3", "integration"],
=======
"evergreen_loader": "linux-x64x11",
"on_host_test": true,
"on_host_test_shards": ["0", "1", "2", "3", "blackbox", "wpt"],
>>>>>>> 73a025ce5d8 (Cherry pick PR #2777: Reorder GitHub workflow steps. (#2782))
"platforms": [
"linux-x64x11",
"linux-x64x11-egl",
Expand Down
Loading

0 comments on commit d6b515d

Please sign in to comment.