diff options
author | Andrew Grimberg <agrimberg@linuxfoundation.org> | 2024-05-30 12:05:25 -0700 |
---|---|---|
committer | Andrew Grimberg <agrimberg@linuxfoundation.org> | 2024-05-30 12:05:25 -0700 |
commit | 78aa2243addb86672cc8d584be6c2f7cd29fd933 (patch) | |
tree | 11c02cefec14507b415ddb44dc003a9e94b59f52 | |
parent | 20640554115136650d70f11fd9da95bf8811229e (diff) |
CI: Add GHA verify job to repository
Change-Id: Ifa9d532cd1bd901b470400dde8ed533a619f73ef
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
-rw-r--r-- | .github/workflows/gerrit-verify.yaml | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/.github/workflows/gerrit-verify.yaml b/.github/workflows/gerrit-verify.yaml new file mode 100644 index 0000000..480d121 --- /dev/null +++ b/.github/workflows/gerrit-verify.yaml @@ -0,0 +1,102 @@ +--- +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 The Linux Foundation +name: Gerrit Verify + +# yamllint disable-line rule:truthy +on: + workflow_dispatch: + inputs: + GERRIT_BRANCH: + description: "Branch that change is against" + required: true + type: string + GERRIT_CHANGE_ID: + description: "The ID for the change" + required: true + type: string + GERRIT_CHANGE_NUMBER: + description: "The Gerrit number" + required: true + type: string + GERRIT_CHANGE_URL: + description: "URL to the change" + required: true + type: string + GERRIT_EVENT_TYPE: + description: "Type of Gerrit event" + required: true + type: string + GERRIT_PATCHSET_NUMBER: + description: "The patch number for the change" + required: true + type: string + GERRIT_PATCHSET_REVISION: + description: "The revision sha" + required: true + type: string + GERRIT_PROJECT: + description: "Project in Gerrit" + required: true + type: string + GERRIT_REFSPEC: + description: "Gerrit refspec of change" + required: true + type: string + +concurrency: + # yamllint disable-line rule:line-length + group: ${{ github.workflow }}-${{ github.event.inputs.GERRIT_BRANCH}}-${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }} + cancel-in-progress: true + +jobs: + clear-vote: + runs-on: ubuntu-latest + steps: + - name: Clear votes + # yamllint disable-line rule:line-length + uses: lfit/gerrit-review-action@9627b9a144f2a2cad70707ddfae87c87dce60729 # v0.8 + with: + host: ${{ vars.GERRIT_SERVER }} + username: ${{ vars.GERRIT_SSH_USER }} + key: ${{ secrets.GERRIT_SSH_PRIVKEY }} + known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }} + gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }} + gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }} + vote-type: clear + - name: Allow replication + run: sleep 10s + + lint: + needs: clear-vote + # yamllint disable-line rule:line-length + uses: lfit/releng-reusable-verify-actions/.github/workflows/compose-repo-linting.yaml@main + with: + GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }} + GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }} + GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }} + GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }} + GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }} + GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }} + GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }} + GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }} + GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }} + + vote: + if: ${{ always() }} + needs: [lint] + runs-on: ubuntu-latest + steps: + - name: Get workflow conclusion + uses: technote-space/workflow-conclusion-action@v3 + - name: Vote + # yamllint disable-line rule:line-length + uses: lfit/gerrit-review-action@9627b9a144f2a2cad70707ddfae87c87dce60729 # v0.8 + with: + host: ${{ vars.GERRIT_SERVER }} + username: ${{ vars.GERRIT_SSH_USER }} + key: ${{ secrets.GERRIT_SSH_PRIVKEY }} + known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }} + gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }} + gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }} + vote-type: ${{ env.WORKFLOW_CONCLUSION }} |