From 9d204d274cc740f88234726f88a2479e9dbc48f5 Mon Sep 17 00:00:00 2001 From: Igor Sarkisov Date: Wed, 24 May 2023 16:07:56 -0700 Subject: [PATCH] Set up workflows for 25.lts branch b/293645066 --- .../{android.yaml => android_25.lts.1+.yaml} | 8 +- .github/workflows/coverage.yaml | 30 ---- ...vergreen.yaml => evergreen_25.lts.1+.yaml} | 8 +- .../{gradle.yaml => gradle_25.lts.1+.yaml} | 5 +- .github/workflows/label-cherry-pick.yaml | 135 ----------------- .github/workflows/lint.yaml | 68 --------- .../{linux.yaml => linux_25.lts.1+.yaml} | 8 +- .github/workflows/manual-cherry-pick.yaml | 73 --------- .github/workflows/nightly_trigger.yaml | 141 ------------------ .../workflows/nightly_trigger_24.lts.1+.yaml | 30 ---- .github/workflows/outside_collaborator.yaml | 35 ----- .github/workflows/pr_badges.yaml | 69 --------- .../{pytest.yaml => pytest_25.lts.1+.yaml} | 5 +- .../{raspi-2.yaml => raspi-2_25.lts.1+.yaml} | 8 +- .github/workflows/scorecards.yml | 58 ------- .../{stub.yaml => stub_25.lts.1+.yaml} | 8 +- .github/workflows/unit_test_report.yaml | 108 -------------- .../{win32.yaml => win32_25.lts.1+.yaml} | 8 +- .github/workflows/workflow_trigger.yaml | 49 ------ .../{xb1.yaml => xb1_25.lts.1+.yaml} | 8 +- 20 files changed, 25 insertions(+), 837 deletions(-) rename .github/workflows/{android.yaml => android_25.lts.1+.yaml} (97%) delete mode 100644 .github/workflows/coverage.yaml rename .github/workflows/{evergreen.yaml => evergreen_25.lts.1+.yaml} (95%) rename .github/workflows/{gradle.yaml => gradle_25.lts.1+.yaml} (94%) delete mode 100644 .github/workflows/label-cherry-pick.yaml delete mode 100644 .github/workflows/lint.yaml rename .github/workflows/{linux.yaml => linux_25.lts.1+.yaml} (94%) delete mode 100644 .github/workflows/manual-cherry-pick.yaml delete mode 100644 .github/workflows/nightly_trigger.yaml delete mode 100644 .github/workflows/nightly_trigger_24.lts.1+.yaml delete mode 100644 .github/workflows/outside_collaborator.yaml delete mode 100644 .github/workflows/pr_badges.yaml rename .github/workflows/{pytest.yaml => pytest_25.lts.1+.yaml} (95%) rename .github/workflows/{raspi-2.yaml => raspi-2_25.lts.1+.yaml} (90%) delete mode 100644 .github/workflows/scorecards.yml rename .github/workflows/{stub.yaml => stub_25.lts.1+.yaml} (87%) delete mode 100644 .github/workflows/unit_test_report.yaml rename .github/workflows/{win32.yaml => win32_25.lts.1+.yaml} (87%) delete mode 100644 .github/workflows/workflow_trigger.yaml rename .github/workflows/{xb1.yaml => xb1_25.lts.1+.yaml} (87%) diff --git a/.github/workflows/android.yaml b/.github/workflows/android_25.lts.1+.yaml similarity index 97% rename from .github/workflows/android.yaml rename to .github/workflows/android_25.lts.1+.yaml index 852bbbcc7d76..b47169b8964e 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android_25.lts.1+.yaml @@ -1,4 +1,4 @@ -name: android +name: android_25.lts.1+ on: release: @@ -6,12 +6,10 @@ on: pull_request: types: [opened, reopened, synchronize, labeled] branches: - - main - - feature/* + - '25.lts.1\+' push: branches: - - main - - feature/* + - '25.lts.1\+' schedule: # GMT timezone. - cron: '0 9 * * *' diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml deleted file mode 100644 index ca05562995e1..000000000000 --- a/.github/workflows/coverage.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: coverage - -on: - # pull_request: - # types: - # - opened - # - edited - # - reopened - # - synchronize - push: - branches: - - main - - feature/* - -jobs: - linux-coverage: - # TODO(b/286302961): Move back and re-enable this check once sharding is supported. - # Run on main branch for pushes, PRs and manual invocations. - # if: | - # ${{ github.ref == 'refs/heads/main' && - # (github.event_name == 'push' || - # github.event_name == 'pull_request' || - # (github.event_name == 'workflow_dispatch' && inputs.nightly == 'false')) }} - uses: ./.github/workflows/main.yaml - permissions: - packages: write - pull-requests: write - with: - platform: linux-coverage - nightly: ${{ github.event.inputs.nightly }} diff --git a/.github/workflows/evergreen.yaml b/.github/workflows/evergreen_25.lts.1+.yaml similarity index 95% rename from .github/workflows/evergreen.yaml rename to .github/workflows/evergreen_25.lts.1+.yaml index 8e60d8ecc743..8abb73f29aa9 100644 --- a/.github/workflows/evergreen.yaml +++ b/.github/workflows/evergreen_25.lts.1+.yaml @@ -1,15 +1,13 @@ -name: evergreen +name: evergreen_25.lts.1+ on: pull_request: types: [opened, reopened, synchronize, labeled] branches: - - main - - feature/* + - '25.lts.1\+' push: branches: - - main - - feature/* + - '25.lts.1\+' schedule: # GMT timezone. - cron: '0 9 * * *' diff --git a/.github/workflows/gradle.yaml b/.github/workflows/gradle_25.lts.1+.yaml similarity index 94% rename from .github/workflows/gradle.yaml rename to .github/workflows/gradle_25.lts.1+.yaml index 7dec25a39585..a7d309844d50 100644 --- a/.github/workflows/gradle.yaml +++ b/.github/workflows/gradle_25.lts.1+.yaml @@ -1,11 +1,10 @@ -name: Java Tests +name: Java Tests 25.lts.1+ on: pull_request: push: branches: - - main - - feature/* + - '25.lts.1\+' concurrency: group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.number || github.sha }}' diff --git a/.github/workflows/label-cherry-pick.yaml b/.github/workflows/label-cherry-pick.yaml deleted file mode 100644 index f58d0a458944..000000000000 --- a/.github/workflows/label-cherry-pick.yaml +++ /dev/null @@ -1,135 +0,0 @@ -name: Label Cherry Pick - -on: - pull_request_target: - types: - - labeled - - closed - -jobs: - prepare_branch_list: - runs-on: ubuntu-latest - if: | - github.event.pull_request.merged == true && - github.event.pull_request.merge_commit_sha != null - outputs: - target_branch: ${{ steps.set-branches.outputs.target_branch }} - steps: - - name: Set Branches - id: set-branches - env: - PR_LABELS: ${{ toJson(github.event.pull_request.labels) }} - EVENT_ACTION: ${{ github.event.action }} - LABEL_NAME: ${{ github.event.label.name }} - BASE_REF: ${{ github.base_ref }} - run: | - if [[ $EVENT_ACTION == 'closed' ]]; then - # Get a list of the labels from the PR. - labels=$(echo "$PR_LABELS" | jq -r '.[].name') - else - # Or get the label that was added on the merged PR. - labels=$LABEL_NAME - fi - - branches=("24.lts.1+" "23.lts.1+" "22.lts.1+" "21.lts.1+" "20.lts.1+" "19.lts.1+" "rc_11" "COBALT_9") - filtered_branches=() - for branch in "${branches[@]}"; do - if [[ $branch == $BASE_REF ]]; then - continue - fi - if [[ ${labels[@]} =~ "cp-$branch" ]]; then - filtered_branches+=("$branch") - fi - done - - echo "target_branch=$(echo -n "${filtered_branches[@]}" | jq -cRs 'split(" ")')" >> $GITHUB_OUTPUT - - cherry_pick: - runs-on: ubuntu-latest - permissions: - issues: write - needs: prepare_branch_list - if: needs.prepare_branch_list.outputs.target_branch != '[]' - strategy: - matrix: - target_branch: ${{ fromJson(needs.prepare_branch_list.outputs.target_branch) }} - env: - ACCESS_TOKEN: ${{ secrets.CHERRY_PICK_TOKEN }} - REPOSITORY: ${{ github.repository }} - GITHUB_REF: ${{ github.ref }} - MERGE_COMMIT_SHA: ${{ github.event.pull_request.merge_commit_sha }} - CHERRY_PICK_BRANCH: cherry-pick-${{ matrix.target_branch }}-${{ github.event.pull_request.number }} - steps: - - name: Checkout repository - uses: kaidokert/checkout@v3.5.999 - timeout-minutes: 30 - with: - ref: ${{ matrix.target_branch }} - fetch-depth: 0 - persist-credentials: false - - - name: Setup Git - run: | - git config --global user.name "GitHub Release Automation" - git config --global user.email "github@google.com" - - - name: Cherry pick merge commit - id: cherry-pick - continue-on-error: true - run: | - set -x - git fetch origin ${{ matrix.target_branch }} - - set +e - # Select the first parent as the mainline tree. This is necessary if - # the commit has multiple parents as the cherry-pick will fail otherwise. - git cherry-pick -x --mainline=1 ${MERGE_COMMIT_SHA} - RES=$? - set -e - if [ ${RES} -ne 0 ]; then - # If the cherry pick failed due to a merge conflict we can - # add the conflicting file and create the commit anyway. - git add . - git cherry-pick --continue - fi - exit ${RES} - - - name: Create Pull Request - id: create-pr - continue-on-error: true - uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3 - with: - token: ${{ secrets.CHERRY_PICK_TOKEN }} - draft: ${{ steps.cherry-pick.outcome == 'failure' }} - base: ${{ matrix.target_branch }} - branch: ${{ env.CHERRY_PICK_BRANCH }} - committer: GitHub Release Automation - reviewers: ${{ github.event.pull_request.user.login }} - title: "Cherry pick PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}" - body: | - Refer to the original PR: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} - - ${{ github.event.pull_request.body }} - - - name: Comment on failure - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.CHERRY_PICK_TOKEN }} - script: | - if ('${{ steps.create-pr.outputs.pull-request-number }}' == '') { - // Comment on the originating PR if creating a cherry pick PR failed. - github.rest.issues.createComment({ - issue_number: context.payload.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '> [!IMPORTANT]\n> Creating the cherry pick PR failed! Check the log at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} for details.' - }); - } else if ('${{ steps.cherry-pick.outcome }}' == 'failure') { - // Comment on the new PR if the cherry pick failed. - github.rest.issues.createComment({ - issue_number: '${{ steps.create-pr.outputs.pull-request-number }}', - owner: context.repo.owner, - repo: context.repo.repo, - body: '> [!IMPORTANT]\n> There were merge conflicts while cherry picking! Check out [${{ env.CHERRY_PICK_BRANCH }}](${{ github.repository }}/tree/${{ env.CHERRY_PICK_BRANCH }}) and fix the conflicts before proceeding. Check the log at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} for details.' - }); - } diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 59e8db0fa137..000000000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,68 +0,0 @@ -name: lint - -on: - pull_request: - types: - - opened - - edited - - reopened - - synchronize - push: - branches: - - main - - feature/* - -concurrency: - group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.number || github.sha }}' - cancel-in-progress: true - -permissions: {} - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Install clang-format Dependencies - run: | - sudo apt-get update - sudo apt-get install libncurses5 - - name: Download GN via CIPD - env: - GN_SHA256SUM: 'af7b2dcb3905bca56655e12131b365f1cba8e159db80d2022330c4f522fab2ef /tmp/gn.zip' - GN_HASH: r3styzkFvKVmVeEhMbNl8cuo4VnbgNICIzDE9SL6su8C - run: | - set -e -x - curl --location --silent --output /tmp/gn.zip "https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/${GN_HASH}" - echo ${GN_SHA256SUM} | sha256sum --check - unzip /tmp/gn.zip -d /usr/local/bin - rm /tmp/gn.zip - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - timeout-minutes: 30 - with: - fetch-depth: 0 - persist-credentials: false - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.7' - - name: Install Pip Packages - run: pip install -r ${GITHUB_WORKSPACE}/requirements.txt - - name: Download Resources - run: python ${GITHUB_WORKSPACE}/download_resources.py - - name: pre-commit - uses: ./.github/actions/pre_commit - with: - base_ref: ${{ github.event.pull_request.base.sha && github.event.pull_request.base.sha || github.event.before }} - check-bug-id: - name: Check Bug ID - runs-on: ubuntu-latest - steps: - - name: Check Bug ID Present - # v2 - uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee - with: - accessToken: ${{ secrets.GITHUB_TOKEN }} - pattern: '(b\/\d+|^(Bug|Fixed|Issue): \d+$)' - flags: 'gm' - error: 'PR title or description should include at least one bug ID.' diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux_25.lts.1+.yaml similarity index 94% rename from .github/workflows/linux.yaml rename to .github/workflows/linux_25.lts.1+.yaml index f144ef72f4ab..2c5028d403c2 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux_25.lts.1+.yaml @@ -1,15 +1,13 @@ -name: linux +name: linux_25.lts.1+ on: pull_request: types: [opened, reopened, synchronize, labeled] branches: - - main - - feature/* + - '25.lts.1\+' push: branches: - - main - - feature/* + - '25.lts.1\+' schedule: # GMT timezone. - cron: '0 9 * * *' diff --git a/.github/workflows/manual-cherry-pick.yaml b/.github/workflows/manual-cherry-pick.yaml deleted file mode 100644 index f48cb117defc..000000000000 --- a/.github/workflows/manual-cherry-pick.yaml +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2023 The Cobalt Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Usage: Go to -# https://https://github.com/youtube/cobalt/actions/workflows/manual-cherry-pick.yaml -# and click "Run Workflow." Leave "Use Workflow From" set to "main", then -# input the branch name and paste the cherry-pick commit and click Run. A PR -# will be created. - -name: Release Branch Cherrypick -on: - workflow_dispatch: - inputs: - # We use this instead of the "run on branch" argument because GitHub looks - # on that branch for a workflow.yml file, and we'd have to cherry-pick - # this file into those branches. - release_branch: - description: 'Release branch name (e.g. 23.lts.1+)' - required: true - type: string - git_commit: - description: 'Git commit to cherry-pick' - required: true - type: string - -jobs: - cherrypick: - name: Cherrypick to ${{ github.event.inputs.release_branch}} - ${{ github.event.inputs.git_commit }} - runs-on: ubuntu-latest - env: - ACCESS_TOKEN: ${{ secrets.CHERRY_PICK_TOKEN }} - RELEASE_BRANCH: ${{ github.event.inputs.release_branch }} - COMMIT_HASH: ${{ github.event.inputs.git_commit }} - REPOSITORY: ${{ github.repository }} - GITHUB_REF: ${{ github.ref }} - steps: - - name: Checkout code - uses: kaidokert/checkout@v3.5.999 - timeout-minutes: 30 - with: - ref: ${{ env.RELEASE_BRANCH }} - persist-credentials: false - - name: Get some helpful info for formatting - id: cherrypick - run: | - git config --global user.name "GitHub Release Automation" - git config --global user.email "github@google.com" - git fetch origin $GITHUB_REF - git cherry-pick -x $COMMIT_HASH - echo "SHORTSHA=$(git log -1 $COMMIT_HASH --format="%h")" >> "$GITHUB_OUTPUT" - echo "TITLE=$(git log -1 $COMMIT_HASH --format="%s")" >> "$GITHUB_OUTPUT" - - name: Create Pull Request with changes - uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3 - with: - title: '${{ env.RELEASE_BRANCH }} cherry-pick: ${{ steps.cherrypick.outputs.SHORTSHA }} "${{ steps.cherrypick.outputs.TITLE }}"' - committer: GitHub Release Automation - token: ${{ secrets.CHERRY_PICK_TOKEN }} - base: ${{ env.RELEASE_BRANCH }} - branch: ${{ env.RELEASE_BRANCH }}-${{ steps.cherrypick.outputs.SHORTSHA }} - reviewers: ${{ github.actor }} - body: | - Refer to the original commit: https://github.com/${{ github.repository }}/commit/${{ github.event.inputs.git_commit }} diff --git a/.github/workflows/nightly_trigger.yaml b/.github/workflows/nightly_trigger.yaml deleted file mode 100644 index 22f155674572..000000000000 --- a/.github/workflows/nightly_trigger.yaml +++ /dev/null @@ -1,141 +0,0 @@ -name: nightly_trigger - -on: - schedule: - # GMT timezone. - - cron: '0 9 * * *' - workflow_dispatch: - -jobs: - trigger_23: - permissions: - actions: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - ref: 23.lts.1+ - persist-credentials: false - - name: Trigger Nightly - run: | - set -x - gh workflow run android_23.lts.1+ --ref 23.lts.1+ -f nightly=true - 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: - permissions: - actions: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - ref: 22.lts.1+ - persist-credentials: false - - name: Trigger Nightly - run: | - set -x - gh workflow run android_22.lts.1+ --ref 22.lts.1+ -f nightly=true - gh workflow run evergreen_22.lts.1+ --ref 22.lts.1+ -f nightly=true - gh workflow run linux_22.lts.1+ --ref 22.lts.1+ -f nightly=true - gh workflow run raspi-2_22.lts.1+ --ref 22.lts.1+ -f nightly=true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - trigger_21: - permissions: - actions: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - ref: 21.lts.1+ - persist-credentials: false - - name: Trigger Nightly - run: | - set -x - gh workflow run evergreen_21.lts.1+ --ref 21.lts.1+ -f nightly=true - gh workflow run linux_21.lts.1+ --ref 21.lts.1+ -f nightly=true - gh workflow run raspi-2_21.lts.1+ --ref 21.lts.1+ -f nightly=true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - trigger_20: - permissions: - actions: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - ref: 20.lts.1+ - persist-credentials: false - - name: Trigger Nightly - run: | - set -x - gh workflow run linux_20.lts.1+ --ref 20.lts.1+ -f nightly=true - gh workflow run raspi-2_20.lts.1+ --ref 20.lts.1+ -f nightly=true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - trigger_19: - permissions: - actions: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - ref: 19.lts.1+ - persist-credentials: false - - name: Trigger Nightly - run: | - set -x - gh workflow run linux_19.lts.1+ --ref 19.lts.1+ -f nightly=true - gh workflow run raspi-2_19.lts.1+ --ref 19.lts.1+ -f nightly=true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - trigger_rc_11: - permissions: - actions: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - ref: rc_11 - persist-credentials: false - - name: Trigger Nightly - run: | - set -x - gh workflow run linux_rc_11 --ref rc_11 -f nightly=true - gh workflow run raspi-2_rc_11 --ref rc_11 -f nightly=true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - trigger_cobalt_9: - permissions: - actions: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - ref: COBALT_9 - persist-credentials: false - - name: Trigger Nightly - run: | - set -x - gh workflow run linux_COBALT_9 --ref COBALT_9 -f nightly=true - gh workflow run raspi-2_COBALT_9 --ref COBALT_9 -f nightly=true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/nightly_trigger_24.lts.1+.yaml b/.github/workflows/nightly_trigger_24.lts.1+.yaml deleted file mode 100644 index 45ca3996b958..000000000000 --- a/.github/workflows/nightly_trigger_24.lts.1+.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: nightly_trigger_24.lts.1+ - -on: - schedule: - # GMT timezone. - - cron: '0 10 * * *' - workflow_dispatch: - -jobs: - trigger_24: - permissions: - actions: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - ref: 24.lts.1+ - persist-credentials: false - - name: Trigger Nightly - run: | - set -x - gh workflow run android_24.lts.1+ --ref 24.lts.1+ -f nightly=true - gh workflow run evergreen_24.lts.1+ --ref 24.lts.1+ -f nightly=true - gh workflow run linux_24.lts.1+ --ref 24.lts.1+ -f nightly=true - gh workflow run raspi-2_24.lts.1+ --ref 24.lts.1+ -f nightly=true - gh workflow run win32_24.lts.1+ --ref 24.lts.1+ -f nightly=true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/outside_collaborator.yaml b/.github/workflows/outside_collaborator.yaml deleted file mode 100644 index a8913e38a454..000000000000 --- a/.github/workflows/outside_collaborator.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Outside Collaborator - -on: - pull_request_target: - types: - - opened - - reopened - -concurrency: - group: '${{ github.workflow }}-${{ github.event_name }} @ ${{ github.event.pull_request.number || github.sha }}' - cancel-in-progress: true - -jobs: - assign-reviewer: - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Check if PR author is outside collaborator - env: - PR_AUTHOR_LOGIN: ${{ github.event.pull_request.user.login }} - REPO_NAME: ${{ github.event.repository.full_name }} - PR_NUMBER: ${{ github.event.number }} - run: | - PERMISSION_LEVEL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/$REPO_NAME/collaborators/$PR_AUTHOR_LOGIN/permission" | jq -r .role_name) - - if [ "$PERMISSION_LEVEL" == "none" ] || [ "$PERMISSION_LEVEL" == "read" ]; then - echo "PR author is an outside collaborator. Adding label..." - - curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Accept: application/vnd.github.v3+json" \ - -d '["outside collaborator"]' \ - "https://api.github.com/repos/$REPO_NAME/issues/$PR_NUMBER/labels" - fi diff --git a/.github/workflows/pr_badges.yaml b/.github/workflows/pr_badges.yaml deleted file mode 100644 index 3fcd93ed8c54..000000000000 --- a/.github/workflows/pr_badges.yaml +++ /dev/null @@ -1,69 +0,0 @@ -name: PR badges - -on: - pull_request_target: - branches: - - 'feature/*' - - 'main' - - '24.lts.1\+' - - '23.lts.1\+' - - '22.lts.1\+' - - '21.lts.1\+' - - '20.lts.1\+' - - '19.lts.1\+' - - 'rc_11' - - 'COBALT_9' - -concurrency: - group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.number || github.sha }}' - cancel-in-progress: true - -permissions: - pull-requests: write - -jobs: - comment: - runs-on: ubuntu-latest - env: - GITHUB_SERVER_URL: ${{github.server_url}} - GITHUB_REPO: ${{github.repository}} - GITHUB_HEAD_REF: ${{ github.head_ref }} - steps: - - uses: actions/github-script@v6 - with: - script: | - // Get env vars. - const { GITHUB_SERVER_URL, GITHUB_REPO, GITHUB_HEAD_REF } = process.env - // Get the existing comments. - const {data: comments} = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.number, - }) - - // Find any comment already made by the bot. - 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"] - var commentBody = ` - ## Build Status - | Workflow | Status | - | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - ` - for (let i = 0; i < workflows.length; i++) { - commentBody += "| " + workflows[i] + " | [![" + workflows[i] + "](" + `${GITHUB_SERVER_URL}` + "/" + `${GITHUB_REPO}` + "/actions/workflows/" + workflows[i] + ".yaml/badge.svg?branch=" + `${GITHUB_HEAD_REF}` + ")](" + `${GITHUB_SERVER_URL}` + "/" + `${GITHUB_REPO}` + "/actions/workflows/" + workflows[i] + ".yaml?query=branch%3A" + `${GITHUB_HEAD_REF}` + ") |\n" - } - if (botComment) { - await github.rest.issues.deleteComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: botComment.id, - }) - } - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.number, - body: commentBody - }) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest_25.lts.1+.yaml similarity index 95% rename from .github/workflows/pytest.yaml rename to .github/workflows/pytest_25.lts.1+.yaml index 1b282e407929..0951c7d8cbfb 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest_25.lts.1+.yaml @@ -1,11 +1,10 @@ -name: python-tests +name: python-tests_25.lts.1+ on: pull_request: push: branches: - - main - - feature/* + - '25.lts.1\+' concurrency: group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.number || github.sha }}' diff --git a/.github/workflows/raspi-2.yaml b/.github/workflows/raspi-2_25.lts.1+.yaml similarity index 90% rename from .github/workflows/raspi-2.yaml rename to .github/workflows/raspi-2_25.lts.1+.yaml index 8613cfaf83d2..c6ba7e2ff9a3 100644 --- a/.github/workflows/raspi-2.yaml +++ b/.github/workflows/raspi-2_25.lts.1+.yaml @@ -1,15 +1,13 @@ -name: raspi-2 +name: raspi-2_25.lts.1+ on: pull_request: types: [opened, reopened, synchronize, labeled] branches: - - main - - feature/* + - '25.lts.1\+' push: branches: - - main - - feature/* + - '25.lts.1\+' schedule: # GMT timezone. - cron: '0 9 * * *' diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml deleted file mode 100644 index 4514e18291e0..000000000000 --- a/.github/workflows/scorecards.yml +++ /dev/null @@ -1,58 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. They are provided -# by a third-party and are governed by separate terms of service, privacy -# policy, and support documentation. - -name: Scorecards supply-chain security -on: - # For Branch-Protection check. Only the default branch is supported. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection - branch_protection_rule: - # To guarantee Maintained check is occasionally updated. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained - schedule: - - cron: '18 14 * * 1' - push: - branches: [ main ] - pull_request: - branches: [ main ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecards analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - # Needed to publish results and get a badge (see publish_results below). - id-token: write - - steps: - - name: "Checkout code" - uses: actions/checkout@v3 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2 - with: - results_file: results.sarif - results_format: sarif - publish_results: true - - # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF - # format to the repository Actions tab. - - name: "Upload artifact" - uses: actions/upload-artifact@v3.1.1 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard. - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@v2.1.37 - with: - sarif_file: results.sarif diff --git a/.github/workflows/stub.yaml b/.github/workflows/stub_25.lts.1+.yaml similarity index 87% rename from .github/workflows/stub.yaml rename to .github/workflows/stub_25.lts.1+.yaml index 17e8b74082f5..65fb7c9fe171 100644 --- a/.github/workflows/stub.yaml +++ b/.github/workflows/stub_25.lts.1+.yaml @@ -1,15 +1,13 @@ -name: stub +name: stub_25.lts.1+ on: pull_request: types: [opened, reopened, synchronize, labeled] branches: - - main - - feature/* + - '25.lts.1\+' push: branches: - - main - - feature/* + - '25.lts.1\+' workflow_dispatch: inputs: nightly: diff --git a/.github/workflows/unit_test_report.yaml b/.github/workflows/unit_test_report.yaml deleted file mode 100644 index 5d9cf16af4c2..000000000000 --- a/.github/workflows/unit_test_report.yaml +++ /dev/null @@ -1,108 +0,0 @@ -name: Upload Unit Test Results - -on: - workflow_run: - workflows: - - evergreen - - linux - - win32 - types: - - completed - -# TODO(b/293508740): Report failed workflow runs back to triggering PR. - -jobs: - unit-test-report: - permissions: - pull-requests: write - if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }} - runs-on: ubuntu-latest - name: Upload Unit Test Reports - steps: - - name: Download '${{ github.event.workflow_run.name }}' Unit Test Results - # The `download-artifact` action can only access artifacts that were uploaded in the same workflow. - # Since it was not this workflow that uploaded the artifacts we must use rest api to download them. - # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow - uses: actions/github-script@v6 - with: - script: | - const name = context.payload.workflow_run.name; - const url = context.payload.workflow_run.html_url; - - console.log(`Downloading artifacts from ${url}`) - context.payload.workflow_run.pull_requests.forEach(pr => { - console.log(`Pull request: ${context.payload.repository.html_url}/pull/${pr.number}`); - }); - - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id - }); - - let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "unit-test-results" - }); - - if (matchArtifacts.length == 1) { - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifacts[0].id, - archive_format: 'zip' - }); - let fs = require('fs'); - const path = `${process.env.GITHUB_WORKSPACE}/unit-test-results.zip`; - fs.writeFileSync(path, Buffer.from(download.data)); - } else { - core.setFailed(`Expected one artifact with name 'unit-test-results'. Found ${matchArtifacts.length}.`); - } - - name: Extract Archived Unit Test Results - run: unzip unit-test-results.zip -d unit-test-results - - name: Get Datadog CLI - shell: bash - env: - DD_VERSION: 'v2.18.0' - DD_SHA256SUM: 'adbe9b3a41faaf0b1d9702ba256cf8fa9e474c0cc8216f25e5b489c53d6f0a70 datadog-ci' - run: | - set -e - download_url="https://github.com/DataDog/datadog-ci/releases/download/${DD_VERSION}/datadog-ci_linux-x64" - curl -L --fail $download_url --output datadog-ci - echo ${DD_SHA256SUM} | sha256sum --check - chmod +x datadog-ci - - name: Upload to Datadog - # Unit test results are archived on the following format: - # ├── - # │ ├── - # │ │ └── - # │ └── TAGS - # ├── - # │ ├── - # │ │ └── - # │ └── TAGS - # etc. - shell: bash - env: - DATADOG_API_KEY: ${{ secrets.DD_API_KEY }} - DATADOG_SITE: us5.datadoghq.com - DD_ENV: ci - DD_SERVICE: ${{ github.event.repository.name }} - # Need to populate git info via env vars as we don't have the repo to look at. - DD_GIT_REPOSITORY_URL: ${{ github.event.repository.git_url }} - DD_GIT_COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} - DD_GIT_BRANCH: ${{ github.event.workflow_run.head_branch }} - DD_GIT_COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }} - DD_GIT_COMMIT_AUTHOR_NAME: ${{ github.event.workflow_run.head_commit.author.name }} - DD_GIT_COMMIT_AUTHOR_EMAIL: ${{ github.event.workflow_run.head_commit.author.email }} - DD_GIT_COMMIT_AUTHOR_DATE: ${{ github.event.workflow_run.head_commit.timestamp }} - DD_GIT_COMMIT_COMMITTER_NAME: ${{ github.event.workflow_run.head_commit.committer.name }} - DD_GIT_COMMIT_COMMITTER_EMAIL: ${{ github.event.workflow_run.head_commit.committer.email }} - DD_GIT_COMMIT_COMMITTER_DATE: ${{ github.event.workflow_run.head_commit.timestamp }} - run: | - # Loop over each platform, extract the tags and upload xml results. - for dir in unit-test-results/*/; do - echo "Uploading $dir test report" - export DD_TAGS=`cat ${dir}TAGS` - ./datadog-ci junit upload \ - $dir/**/*.xml - done diff --git a/.github/workflows/win32.yaml b/.github/workflows/win32_25.lts.1+.yaml similarity index 87% rename from .github/workflows/win32.yaml rename to .github/workflows/win32_25.lts.1+.yaml index 988cbb2ef464..69093468e6e4 100644 --- a/.github/workflows/win32.yaml +++ b/.github/workflows/win32_25.lts.1+.yaml @@ -1,15 +1,13 @@ -name: win32 +name: win32_25.lts.1+ on: pull_request: types: [opened, reopened, synchronize, labeled] branches: - - main - - feature/* + - '25.lts.1\+' push: branches: - - main - - feature/* + - '25.lts.1\+' schedule: # GTM timezone. - cron: '0 9 * * *' diff --git a/.github/workflows/workflow_trigger.yaml b/.github/workflows/workflow_trigger.yaml deleted file mode 100644 index c4122d889c37..000000000000 --- a/.github/workflows/workflow_trigger.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: workflow_trigger - -on: - workflow_dispatch: - inputs: - branch: - type: choice - description: Branch - options: - - '24.lts.1+' - - '23.lts.1+' - - '22.lts.1+' - - '21.lts.1+' - - '20.lts.1+' - - '19.lts.1+' - - 'rc_11' - - 'COBALT_9' - workflow: - type: choice - description: Workflow name - options: - - 'android' - - 'evergreen' - - 'linux' - - 'raspi' - - 'win32' - nightly: - description: 'Nightly workflow.' - required: true - type: boolean - default: false - -jobs: - trigger: - permissions: - actions: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: kaidokert/checkout@v3.5.999 - with: - fetch-depth: 1 - ref: ${{ github.event.branch }} - - name: Trigger Workflow - run: | - set -x - gh workflow run ${{ github.event.inputs.workflow }}_${{ github.event.inputs.branch }} --ref ${{ github.event.inputs.branch }} -f nightly=${{ github.event.inputs.nightly }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/xb1.yaml b/.github/workflows/xb1_25.lts.1+.yaml similarity index 87% rename from .github/workflows/xb1.yaml rename to .github/workflows/xb1_25.lts.1+.yaml index d819721ee67a..23fbed2417e1 100644 --- a/.github/workflows/xb1.yaml +++ b/.github/workflows/xb1_25.lts.1+.yaml @@ -1,15 +1,13 @@ -name: xb1 +name: xb1_25.lts.1+ on: pull_request: types: [opened, reopened, synchronize, labeled] branches: - - main - - feature/* + - '25.lts.1\+' push: branches: - - main - - feature/* + - '25.lts.1\+' schedule: # GTM timezone. - cron: '0 9 * * *'