Skip to content

Commit

Permalink
Cherry pick PR #2782: Cherry pick PR #2777: Reorder GitHub workflow s…
Browse files Browse the repository at this point in the history
…teps. (#2786)

"Refer to the original PR: #2782"

---------

Co-authored-by: Brian Ting <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and briantting committed Mar 30, 2024
1 parent c7db382 commit 3b1a3ab
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 44 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ 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
BUILD_PLATFORM=${COBALT_BOOTLOADER}
BUILD_PLATFORM=${COBALT_EVERGREEN_LOADER}
BUILD_TARGET='loader_app_install elf_loader_sandbox_install crashpad_handler_install'
fi
# GitHub Runners have home set to /github/home.
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/gn/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ runs:
- name: GN
run: |
set -x
if [ -z ${COBALT_BOOTLOADER+x} ]; then
if [ -z ${COBALT_EVERGREEN_LOADER+x} ]; then
BUILD_PLATFORM=${{ matrix.target_platform }}
EXTRA_GN_ARGUMENTS=${{ matrix.extra_gn_arguments }}
else
BUILD_PLATFORM=${COBALT_BOOTLOADER}
EXTRA_GN_ARGUMENTS=${{ matrix.extra_bootloader_gn_arguments }}
BUILD_PLATFORM=${COBALT_EVERGREEN_LOADER}
EXTRA_GN_ARGUMENTS=${{ matrix.extra_evergreen_loader_gn_arguments }}
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
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
10 changes: 5 additions & 5 deletions .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,7 @@
"target_platform":"evergreen-arm-hardfp",
"target_cpu":"target_cpu=\\\"arm\\\"",
"extra_gn_arguments":"use_asan=false",
"extra_bootloader_gn_arguments":"is_clang=false",
"extra_evergreen_loader_gn_arguments":"is_clang=false",
"dimension": "release_version=regex:10.*"
},
{
Expand All @@ -29,7 +29,7 @@
"target_platform":"evergreen-arm-hardfp",
"target_cpu":"target_cpu=\\\"arm\\\"",
"extra_gn_arguments":"use_asan=false",
"extra_bootloader_gn_arguments":"is_clang=false",
"extra_evergreen_loader_gn_arguments":"is_clang=false",
"sb_api_version":"sb_api_version=14",
"dimension": "release_version=regex:10.*"
},
Expand All @@ -39,7 +39,7 @@
"target_platform":"evergreen-arm-hardfp",
"target_cpu":"target_cpu=\\\"arm\\\"",
"extra_gn_arguments":"use_asan=false",
"extra_bootloader_gn_arguments":"is_clang=false",
"extra_evergreen_loader_gn_arguments":"is_clang=false",
"sb_api_version":"sb_api_version=13",
"dimension": "release_version=regex:10.*"
},
Expand All @@ -49,7 +49,7 @@
"target_platform":"evergreen-arm-hardfp",
"target_cpu":"target_cpu=\\\"arm\\\"",
"extra_gn_arguments":"use_asan=false",
"extra_bootloader_gn_arguments":"is_clang=false",
"extra_evergreen_loader_gn_arguments":"is_clang=false",
"sb_api_version":"sb_api_version=12",
"dimension": "release_version=regex:10.*"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/config/evergreen-x64.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"docker_service": "build-linux-evergreen",
"on_host_test": "true",
"bootloader": "linux-x64x11",
"evergreen_loader": "linux-x64x11",
"on_host_test_shards": ["0", "1", "2", "3", "integration"],
"platforms": [
"evergreen-x64",
Expand Down
2 changes: 1 addition & 1 deletion .github/config/linux.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"docker_service": "build-linux",
"bootloader": "linux-x64x11",
"evergreen_loader": "linux-x64x11",
"on_host_test": "true",
"on_host_test_shards": ["0", "1", "2", "3", "integration"],
"platforms": [
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ jobs:
run: echo "on_host_test=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.on_host_test')" >> $GITHUB_ENV
- id: set-on-host-test-shards
run: echo "on_host_test_shards=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -c '.on_host_test_shards')" >> $GITHUB_ENV
- id: set-on-host-test-bootloader
run: echo "bootloader=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.bootloader')" >> $GITHUB_ENV
- id: set-on-host-test-evergreen-loader
run: echo "evergreen_loader=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.evergreen_loader')" >> $GITHUB_ENV
- id: set-docker-service
run: |
echo "docker_service=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -r '.docker_service')" >> $GITHUB_ENV
Expand All @@ -98,7 +98,7 @@ jobs:
on_device_test_tests: ${{ env.on_device_test_tests }}
on_host_test: ${{ env.on_host_test }}
on_host_test_shards: ${{ env.on_host_test_shards }}
bootloader: ${{ env.bootloader }}
evergreen_loader: ${{ env.evergreen_loader }}
docker_service: ${{ env.docker_service }}

# Builds, tags, and pushes Cobalt docker build images to ghr.
Expand Down Expand Up @@ -192,27 +192,27 @@ jobs:
uses: ./.github/actions/gn
- name: Build Cobalt
uses: ./.github/actions/build
- name: Upload Nightly Artifacts
if: ${{ ( inputs.nightly == 'true' || github.event_name == 'schedule' ) && matrix.config != 'debug' }}
uses: ./.github/actions/upload_nightly_artifacts
- name: Upload On Host Test Artifacts
if: ${{ matrix.config == 'devel' && needs.initialize.outputs.on_host_test == 'true' }}
uses: ./.github/actions/upload_test_artifacts
with:
type: onhost
os: linux
# Build bootloader if necessary.
- name: Set bootloader config
if: ${{ needs.initialize.outputs.bootloader != 'null' && matrix.config == 'devel' }}
run: echo "COBALT_BOOTLOADER=${{needs.initialize.outputs.bootloader}}" >> $GITHUB_ENV
- name: Bootloader GN
if: ${{ needs.initialize.outputs.bootloader != 'null' && ( matrix.config == 'devel' || matrix.config == 'qa' ) }}
# Build Evergreen loader if necessary.
- name: Set Evergreen loader config
if: ${{ needs.initialize.outputs.evergreen_loader != 'null' && matrix.config == 'devel' }}
run: echo "COBALT_EVERGREEN_LOADER=${{needs.initialize.outputs.evergreen_loader}}" >> $GITHUB_ENV
- name: Evergreen loader GN
if: ${{ needs.initialize.outputs.evergreen_loader != 'null' && ( matrix.config == 'devel' || matrix.config == 'qa' ) }}
uses: ./.github/actions/gn
- name: Build Bootloader
if: ${{ needs.initialize.outputs.bootloader != 'null' && ( matrix.config == 'devel' || matrix.config == 'qa' ) }}
- name: Build Evergreen loader
if: ${{ needs.initialize.outputs.evergreen_loader != 'null' && ( matrix.config == 'devel' || matrix.config == 'qa' ) }}
uses: ./.github/actions/build
- name: Upload Bootloader On Host Test Artifacts
if: ${{ needs.initialize.outputs.bootloader != 'null' && matrix.config == 'devel' && needs.initialize.outputs.on_host_test == 'true' }}
- name: Upload Nightly Artifacts
if: ${{ ( inputs.nightly == 'true' || github.event_name == 'schedule' ) && matrix.config != 'debug' }}
uses: ./.github/actions/upload_nightly_artifacts
- name: Upload Evergreen loader On Host Test Artifacts
if: ${{ needs.initialize.outputs.evergreen_loader != 'null' && matrix.config == 'devel' && needs.initialize.outputs.on_host_test == 'true' }}
uses: ./.github/actions/upload_test_artifacts
with:
type: onhost
Expand Down Expand Up @@ -267,9 +267,9 @@ jobs:
echo "PROJECT_NAME=$(gcloud config get-value project)" >> $GITHUB_ENV
echo "GITHUB_RUN_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
echo "WORKFLOW=${{ github.workflow }}" >> $GITHUB_ENV
if [ "${{ needs.initialize.outputs.bootloader }}" != "null" ]; then
if [ "${{ needs.initialize.outputs.evergreen_loader }}" != "null" ]; then
echo "LOADER_CONFIG=${{ matrix.config }}" >> $GITHUB_ENV
echo "LOADER_PLATFORM=${{ needs.initialize.outputs.bootloader }}" >> $GITHUB_ENV
echo "LOADER_PLATFORM=${{ needs.initialize.outputs.evergreen_loader }}" >> $GITHUB_ENV
fi
if [ "${{ matrix.dimension }}" != "null" ]; then
echo "DIMENSION=${{ matrix.dimension }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -324,7 +324,7 @@ jobs:
# For some reason tests complaining about HOME set to /github/home
# with permission denied error.
HOME: /root
COBALT_BOOTLOADER: ${{needs.initialize.outputs.bootloader}}
COBALT_EVERGREEN_LOADER: ${{needs.initialize.outputs.evergreen_loader}}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down

0 comments on commit 3b1a3ab

Please sign in to comment.