Skip to content

gerrit-verify

gerrit-verify #54

---
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
permissions:
contents: read
jobs:
notify-start:
runs-on: ubuntu-latest
steps:
- name: Clear Gerrit vote
# yamllint disable-line rule:line-length
uses: lfreleng-actions/gerrit-review-action@b26a98041c59f9a877048c320313ab13bcc19aae # v1.0.1
with:
host: ${{ vars.GERRIT_SERVER }}
username: ${{ vars.GERRIT_SSH_REQUIRED_USER }}
key: ${{ secrets.GERRIT_SSH_REQUIRED_PRIVKEY }}
known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
vote-type: clear
comment-only: true
csit-verify-tox:
name: csit-verify-tox
runs-on:
- self-hosted
- nomad
- fdio:arch=${{ matrix.executor_arch }}
- fdio:class=builder
- fdio:size=csit
- fdio:namespace=prod
- fdio:os=${{ matrix.os }}
- fdio:workflow=${{ github.run_id }}
strategy:
matrix:
os: [ubuntu2404]
executor_arch: [x86_64]
env:
JOB_NAME: ${{ github.job }}
steps:
- name: Gerrit Checkout
# yamllint disable-line rule:line-length
uses: lfreleng-actions/checkout-gerrit-change-action@8523d768952d9690702b4696a8310d2a84b1be39 # v1.0.1
with:
gerrit-refspec: ${{ github.event.inputs.GERRIT_REFSPEC }}
gerrit-project: ${{ github.event.inputs.GERRIT_PROJECT }}
gerrit-url: ${{ vars.GERRIT_URL }}
delay: "10s"
ref: refs/heads/${{ github.event.inputs.GERRIT_BRANCH }}
- name: Setup Environment
# yamllint disable-line rule:line-length
uses: fdio/.github/.github/actions/setup-executor-env@1b8eff3ffd9d355b28052be9ad22acc57b3430b5
- name: Run CSIT Bootstrap
# yamllint disable-line rule:line-length
uses: fdio/csit/.github/actions/csit-bootstrap@cee2088675d00de5f4a47f386a6c05315bfc170c
with:
bootstrap_script: tox.sh
with_oper: false
- name: Archive Logs
if: ${{ always() }}
# yamllint disable-line rule:line-length
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ github.job }}-${{ github.run_number }}
path: archives/
if-no-files-found: ignore
vote:
if: ${{ always() }}
needs:
- notify-start
- csit-verify-tox
runs-on: ubuntu-latest
steps:
- name: Collect workflow results
id: overall
run: |
if [[ "${{ needs.notify-start.result }}" == "success" && \
"${{ needs.csit-verify-tox.result }}" == "success" ]]; then
echo "result=success" >> "$GITHUB_OUTPUT"
else
echo "result=failure" >> "$GITHUB_OUTPUT"
fi
- name: Gerrit Vote
# yamllint disable-line rule:line-length
uses: lfreleng-actions/gerrit-review-action@b26a98041c59f9a877048c320313ab13bcc19aae # v1.0.1
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: ${{ steps.overall.outputs.result }}
comment-only: true