From 9968f8cae3d5648e60a42550f3223262c3fb6a4a Mon Sep 17 00:00:00 2001 From: Niranjan Yardi Date: Thu, 15 Aug 2024 15:06:19 -0700 Subject: [PATCH] Remove windows github infra (#3960) b/358459975 Removes xb1, win32 builders from github --- .github/actions/docker_win/action.yaml | 76 -------- .github/config/win32.json | 18 -- .github/config/xb1.json | 19 -- .github/workflows/main_win.yaml | 220 ------------------------ .github/workflows/nightly_trigger.yaml | 1 - .github/workflows/pr_badges.yaml | 2 +- .github/workflows/win32.yaml | 32 ---- .github/workflows/workflow_trigger.yaml | 1 - .github/workflows/xb1.yaml | 32 ---- 9 files changed, 1 insertion(+), 400 deletions(-) delete mode 100644 .github/actions/docker_win/action.yaml delete mode 100644 .github/config/win32.json delete mode 100644 .github/config/xb1.json delete mode 100644 .github/workflows/main_win.yaml delete mode 100644 .github/workflows/win32.yaml delete mode 100644 .github/workflows/xb1.yaml diff --git a/.github/actions/docker_win/action.yaml b/.github/actions/docker_win/action.yaml deleted file mode 100644 index bddfa49ed73e..000000000000 --- a/.github/actions/docker_win/action.yaml +++ /dev/null @@ -1,76 +0,0 @@ -name: Docker Image Build -description: Builds Cobalt build docker images. -inputs: - service: - description: "Service name from docker compose." - required: true -runs: - using: "composite" - steps: - - name: Rename Limit - run: git config diff.renameLimit 999999 - shell: bash - - name: Get docker file changes - id: changed-files - uses: tj-actions/changed-files@2d756ea4c53f7f6b397767d8723b3a10a9f35bf2 # v44 - with: - files_ignore: third_party/** - files: | - docker-compose-windows.yml - docker/windows/** - .github/actions/docker_win/** - - name: Retrieve Docker metadata - id: meta - uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0 - with: - images: ${{env.REGISTRY}}/${{github.repository}}/cobalt-${{inputs.service}} - tags: | - type=ref,event=branch - type=ref,event=tag - type=ref,event=pr - - name: Set Docker Tag - run: | - set -x - docker_tag="${{ steps.meta.outputs.tags }}" - docker_tag="${docker_tag%.1[+,-]}" - echo "DOCKER_TAG=${docker_tag}" | head -n 1 >> $GITHUB_ENV - shell: bash - # We need to set docker tag properly for pull requests. In those scenarios where no docker related files - # were changed we need to use an existing image (e.g. main). In cases where docker image is rebuilt we have - # to use tag generated by the image build. - - name: Set Docker Tag - if: ${{ (steps.changed-files.outputs.any_changed == 'false') && (github.event_name == 'pull_request') }} - env: - REPO: ${{ github.repository }} - run: echo "DOCKER_TAG=ghcr.io/${REPO}/cobalt-${{inputs.service}}:${GITHUB_BASE_REF%.1+}" >> $GITHUB_ENV - shell: bash - - name: Process Docker metadata - id: process-docker - run: | - set -x - set +e - docker manifest inspect $DOCKER_TAG > /dev/null - if [[ $? -ne 0 || ${{ steps.changed-files.outputs.any_changed }} == 'true' ]]; then - echo "need_to_build=true" >> $GITHUB_ENV - else - echo "need_to_build=false" >> $GITHUB_ENV - fi - shell: bash - - name: Build containers with Docker Compose - if: env.need_to_build == 'true' - env: - DOCKER_CPUS: 2 - SERVICE: ${{inputs.service}} - shell: bash - run: | - set -xue - docker compose -f docker-compose-windows.yml up --no-start "${SERVICE}" - - name: Tag images - if: ${{ (env.need_to_build == 'true') && ((github.event_name != 'pull_request') || (!github.event.pull_request.head.repo.fork)) }} - run: | - docker tag cobalt-${{inputs.service}} $DOCKER_TAG - shell: bash - - name: Push images - if: ${{ (env.need_to_build == 'true') && ((github.event_name != 'pull_request') || (!github.event.pull_request.head.repo.fork)) }} - run: docker push ${DOCKER_TAG} - shell: bash diff --git a/.github/config/win32.json b/.github/config/win32.json deleted file mode 100644 index 4ffbc7cbb3e3..000000000000 --- a/.github/config/win32.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "docker_service": "build-win-win32", - "docker_runner_service": "runner-win-win32", - "runner_tag": "win32", - "platforms": [ - "win32" - ], - "on_host_test": true, - "on_host_test_shards": ["0", "1", "2", "3"], - "includes": [ - { - "name":"win32", - "platform":"win32", - "target_platform":"win-win32", - "extra_gn_arguments":"is_clang=false" - } - ] -} diff --git a/.github/config/xb1.json b/.github/config/xb1.json deleted file mode 100644 index 39d6247f5aca..000000000000 --- a/.github/config/xb1.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "docker_service": "build-xb1", - "__comment" : "TODO: Deploy a runner and change this", - "docker_runner_service": "runner-xb1", - "runner_tag": "xb1", - "platforms": [ - "xb1" - ], - "includes": [ - { - "name":"xb1", - "platform":"xb1", - "target_platform":"xb1", - "extra_gn_arguments": "is_clang=false", - "target_cpu": "target_cpu=\\\"x64\\\"", - "target_os": "target_os=\\\"winuwp\\\"" - } - ] -} diff --git a/.github/workflows/main_win.yaml b/.github/workflows/main_win.yaml deleted file mode 100644 index d3ac0cfcb17e..000000000000 --- a/.github/workflows/main_win.yaml +++ /dev/null @@ -1,220 +0,0 @@ -# Reusable Cobalt CI workflow. - -name: main - -on: - workflow_call: - inputs: - platform: - description: 'Cobalt platform.' - required: true - type: string - nightly: - description: 'Nightly workflow.' - required: true - type: string - default: 'false' - modular: - description: 'Whether this is a modular build.' - required: false - type: boolean - default: false - -# Global env vars. -env: - REGISTRY: ghcr.io - IPV6_AVAILABLE: 0 - LANG: en_US.UTF-8 - IS_BUILDBOT_DOCKER: 1 - #BUILD_ID_SERVER_URL: - IS_CI: 1 - IS_DOCKER: 1 - NINJA_STATUS: '[%e sec | %f/%t %u remaining | %c/sec | j%r]' - SCCACHE: 1 - SCCACHE_GCS_BUCKET: cobalt-actions-sccache-windows - SCCACHE_GCS_OAUTH_URL: http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token - SCCACHE_GCS_RW_MODE: READ_WRITE - SCCACHE_IDLE_TIMEOUT: 0 # prevent sccache server from shutting down after long idle. - STARBOARD_TOOLCHAINS_DIR: /root/starboard-toolchains - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.label.name || github.event.pull_request.number || github.sha }} @ ${{ github.event.label.name && github.event.pull_request.number || github.event.action }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # Generates build matrix based on json configuration file. - initialize: - runs-on: ubuntu-latest - permissions: - pull-requests: write - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_PR_REPO_URL: ${{ github.event.pull_request.base.repo.url }} - GITHUB_EVENT_NUMBER: ${{ github.event.number }} - # All triggers except draft PRs, unless PR is labeled with runtest - if: | - github.event.action != 'labeled' || - github.event.pull_request.merged == false && - ( - github.event.action == 'labeled' && - github.event.label.name == 'runtest' || - github.event.label.name == 'on_device' - ) - timeout-minutes: 10 - steps: - - id: Checkout - uses: kaidokert/checkout@v3.5.999 # Temporary version - with: - fetch-depth: 1 - persist-credentials: false - - name: Remove runtest if exists - if: github.event_name == 'pull_request' - continue-on-error: true # Ignore this step if we cannot remove the label. - run: | - set +e - curl \ - -X DELETE \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${GITHUB_TOKEN}" \ - ${GITHUB_PR_REPO_URL}/issues/${GITHUB_EVENT_NUMBER}/labels/runtest - shell: bash - - id: set-platforms - shell: bash - run: | - platforms=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -c '.platforms') - echo "platforms=${platforms}" >> $GITHUB_ENV - - id: set-includes - shell: bash - run: | - includes=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -c '.includes') - echo "includes=${includes}" >> $GITHUB_ENV - - id: set-on-device-test - shell: bash - run: | - on_device_test=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.on_device_test.enabled') - echo "on_device_test=${on_device_test}" >> $GITHUB_ENV - - id: set-on-host-test - shell: bash - run: | - on_host_test=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.on_host_test') - echo "on_host_test=${on_host_test}" >> $GITHUB_ENV - - id: set-on-host-test-shards - shell: bash - run: | - on_host_test_shards=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -c '.on_host_test_shards') - echo "on_host_test_shards=${on_host_test_shards}" >> $GITHUB_ENV - - id: set-docker-service - shell: bash - run: | - docker_service=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.docker_service') - echo "docker_service=${docker_service}" >> $GITHUB_ENV - - id: set-docker-runner-service - shell: bash - run: | - docker_runner_service=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.docker_runner_service') - echo "docker_runner_service=${docker_runner_service}" >> $GITHUB_ENV - - id: set-runner-tag - shell: bash - run: | - runner_tag=$(cat ${GITHUB_WORKSPACE}/.github/config/${{ inputs.platform }}.json | jq -rc '.runner_tag') - echo "runner_tag=${runner_tag}" >> $GITHUB_ENV - outputs: - platforms: ${{ env.platforms }} - includes: ${{ env.includes }} - on_device_test: ${{ env.on_device_test }} - on_host_test: ${{ env.on_host_test }} - on_host_test_shards: ${{ env.on_host_test_shards }} - docker_service: ${{ env.docker_service }} - docker_runner_service: ${{ env.docker_runner_service }} - runner_tag: ${{ env.runner_tag }} - # Build windows docker images. - build-docker-image: - needs: [initialize] - permissions: - packages: write - runs-on: windows-2019 - timeout-minutes: 120 - steps: - - name: Checkout files - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 0 - persist-credentials: false - - name: Login to Docker Registry ${{env.REGISTRY}} - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build docker image - id: build-docker-image - uses: ./.github/actions/docker_win - with: - service: ${{ needs.initialize.outputs.docker_service }} - - name: Build runner docker image - id: build-runner-docker-image - uses: ./.github/actions/docker_win - with: - service: ${{ needs.initialize.outputs.docker_runner_service }} - # Runs builds. - build: - needs: [initialize] - permissions: {} - runs-on: [self-hosted, "${{ needs.initialize.outputs.runner_tag }}"] - name: ${{matrix.name}}_${{matrix.config}} - strategy: - fail-fast: false - matrix: - platform: ${{ fromJson(needs.initialize.outputs.platforms) }} - include: ${{ fromJson(needs.initialize.outputs.includes) }} - config: [devel, debug, qa, gold] - timeout-minutes: 90 - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - # Use fetch depth of 0 to get full history for a valid build id. - fetch-depth: 0 - persist-credentials: false - - name: GN - 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: windows - - # Runs on the host unit and integration tests. - on-host-test: - needs: [initialize, build] - permissions: {} - if: needs.initialize.outputs.on_host_test == 'true' - runs-on: [self-hosted, "${{ needs.initialize.outputs.runner_tag }}"] - name: ${{matrix.name}}_${{matrix.shard}}_test - strategy: - fail-fast: false - matrix: - platform: ${{ fromJson(needs.initialize.outputs.platforms) }} - shard: ${{ fromJson(needs.initialize.outputs.on_host_test_shards) }} - config: [devel] - include: ${{ fromJson(needs.initialize.outputs.includes) }} - env: - MODULAR_BUILD: ${{ inputs.modular && 1 || 0 }} - timeout-minutes: 90 - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - persist-credentials: false - - name: Run Tests - uses: ./.github/actions/on_host_test - with: - os: windows diff --git a/.github/workflows/nightly_trigger.yaml b/.github/workflows/nightly_trigger.yaml index 22f155674572..6bcc16bd27eb 100644 --- a/.github/workflows/nightly_trigger.yaml +++ b/.github/workflows/nightly_trigger.yaml @@ -25,7 +25,6 @@ jobs: gh workflow run evergreen_23.lts.1+ --ref 23.lts.1+ -f nightly=true gh workflow run linux_23.lts.1+ --ref 23.lts.1+ -f nightly=true gh workflow run raspi-2_23.lts.1+ --ref 23.lts.1+ -f nightly=true - gh workflow run win32_23.lts.1+ --ref 23.lts.1+ -f nightly=true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} trigger_22: diff --git a/.github/workflows/pr_badges.yaml b/.github/workflows/pr_badges.yaml index 2484a99d69f4..4cba1f75af8d 100644 --- a/.github/workflows/pr_badges.yaml +++ b/.github/workflows/pr_badges.yaml @@ -46,7 +46,7 @@ jobs: const botComment = comments.find(comment => { return comment.user.type === 'Bot' && comment.body.includes('Build Status') }) - const workflows = ["lint", "android", "evergreen", "linux", "raspi-2", "stub", "win32"] + const workflows = ["lint", "android", "evergreen", "linux", "raspi-2", "stub"] var commentBody = ` ## Build Status | Workflow | Status | diff --git a/.github/workflows/win32.yaml b/.github/workflows/win32.yaml deleted file mode 100644 index 988cbb2ef464..000000000000 --- a/.github/workflows/win32.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: win32 - -on: - pull_request: - types: [opened, reopened, synchronize, labeled] - branches: - - main - - feature/* - push: - branches: - - main - - feature/* - schedule: - # GTM timezone. - - cron: '0 9 * * *' - workflow_dispatch: - inputs: - nightly: - description: 'Nightly workflow.' - required: true - type: boolean - default: false - -jobs: - win32: - uses: ./.github/workflows/main_win.yaml - permissions: - packages: write - pull-requests: write - with: - platform: win32 - nightly: ${{ github.event.inputs.nightly }} diff --git a/.github/workflows/workflow_trigger.yaml b/.github/workflows/workflow_trigger.yaml index 402b41ff3539..ed326899991c 100644 --- a/.github/workflows/workflow_trigger.yaml +++ b/.github/workflows/workflow_trigger.yaml @@ -24,7 +24,6 @@ on: - 'evergreen' - 'linux' - 'raspi' - - 'win32' nightly: description: 'Nightly workflow.' required: true diff --git a/.github/workflows/xb1.yaml b/.github/workflows/xb1.yaml deleted file mode 100644 index d819721ee67a..000000000000 --- a/.github/workflows/xb1.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: xb1 - -on: - pull_request: - types: [opened, reopened, synchronize, labeled] - branches: - - main - - feature/* - push: - branches: - - main - - feature/* - schedule: - # GTM timezone. - - cron: '0 9 * * *' - workflow_dispatch: - inputs: - nightly: - description: 'Nightly workflow.' - required: true - type: boolean - default: false - -jobs: - xb1: - uses: ./.github/workflows/main_win.yaml - permissions: - packages: write - pull-requests: write - with: - platform: xb1 - nightly: ${{ github.event.inputs.nightly }}