blob: e2e8138ae887fc37d2c23374ec717e2dbf4511cf [file] [log] [blame]
Jessica Wagantall57144fb2024-01-31 14:27:35 -08001---
2name: Gerrit Verify
3
4# yamllint disable-line rule:truthy
5on:
6 workflow_dispatch:
7 inputs:
8 GERRIT_BRANCH:
9 description: "Branch that change is against"
10 required: true
11 type: string
12 GERRIT_CHANGE_ID:
13 description: "The ID for the change"
14 required: true
15 type: string
16 GERRIT_CHANGE_NUMBER:
17 description: "The Gerrit number"
18 required: true
19 type: string
20 GERRIT_CHANGE_URL:
21 description: "URL to the change"
22 required: true
23 type: string
24 GERRIT_EVENT_TYPE:
25 description: "Type of Gerrit event"
26 required: true
27 type: string
28 GERRIT_PATCHSET_NUMBER:
29 description: "The patch number for the change"
30 required: true
31 type: string
Jessica Wagantallcfb18c92024-02-06 10:54:20 -080032 GERRIT_PATCHSET_REVISION:
33 description: "The revision sha"
34 required: true
35 type: string
Jessica Wagantall57144fb2024-01-31 14:27:35 -080036 GERRIT_PROJECT:
37 description: "Project in Gerrit"
38 required: true
39 type: string
40 GERRIT_REFSPEC:
41 description: "Gerrit refspec of change"
42 required: true
43 type: string
Jessica Wagantall57144fb2024-01-31 14:27:35 -080044
45concurrency:
46 # yamllint disable-line rule:line-length
47 group: gerrit-verify-${{ github.workflow }}-${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }}
48 cancel-in-progress: true
49
50permissions: read-all
51
52jobs:
53 prepare:
54 runs-on: ubuntu-latest
55 steps:
56 - name: Clear votes
57 uses: lfit/gerrit-review-action@v0.4
58 with:
59 host: ${{ vars.GERRIT_SERVER }}
Jessica Wagantallcfb18c92024-02-06 10:54:20 -080060 username: ${{ vars.GERRIT_SSH_USER }}
61 key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
Jessica Wagantall57144fb2024-01-31 14:27:35 -080062 known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
63 gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
64 gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
65 vote-type: clear
66 comment-only: "true"
67 - name: Allow replication
68 run: sleep 10s
69
70 call-gerrit-tox-verify:
71 needs: prepare
72 # yamllint disable-line rule:line-length
73 uses: lfit/releng-reusable-workflows/.github/workflows/gerrit-compose-required-tox-verify.yaml@main
74 with:
75 GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
76 GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
Jessica Wagantall4f934ba2024-02-07 14:26:40 -080077 GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
78 GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
Jessica Wagantall57144fb2024-01-31 14:27:35 -080079 GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
80 GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
Jessica Wagantall4f934ba2024-02-07 14:26:40 -080081 TOX_ENVS: '["code"]'
Jessica Wagantall57144fb2024-01-31 14:27:35 -080082
83 vote:
84 if: ${{ always() }}
85 # yamllint enable rule:line-length
86 needs: [prepare, call-gerrit-tox-verify]
87 runs-on: ubuntu-latest
88 steps:
89 - uses: technote-space/workflow-conclusion-action@v3
90 - name: Set vote
91 uses: lfit/gerrit-review-action@v0.4
92 with:
93 host: ${{ vars.GERRIT_SERVER }}
Jessica Wagantallcfb18c92024-02-06 10:54:20 -080094 username: ${{ vars.GERRIT_SSH_USER }}
95 key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
Jessica Wagantall57144fb2024-01-31 14:27:35 -080096 known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
97 gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
98 gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
99 vote-type: ${{ env.WORKFLOW_CONCLUSION }}
100 comment-only: "true"