CI: Add test rtdv3 GHA workflow
[doc.git] / .github / workflows / gerrit-verify.yaml
1 ---
2 name: Gerrit Composed rtdv3 Verify
3
4 # yamllint disable-line rule:truthy
5 on:
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
32       GERRIT_PATCHSET_REVISION:
33         description: "The revision sha"
34         required: true
35         type: string
36       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
44
45 jobs:
46   prepare:
47     runs-on: ubuntu-latest
48     steps:
49       - name: Clear votes
50         # yamllint disable-line rule:line-length
51         uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf  # v0.4
52         with:
53           host: ${{ vars.GERRIT_SERVER }}
54           username: ${{ vars.GERRIT_SSH_USER }}
55           key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
56           known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
57           gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
58           gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
59           vote-type: clear
60           comment-only: true
61       - name: Allow replication
62         run: sleep 10s
63
64   rtd-validation:
65     needs: prepare
66     # use compose-jjb-verify from the v0.4 series of releng-reusable-workflows
67     # yamllint disable-line rule:line-length
68     uses: lfit/releng-reusable-workflows/.github/workflows/compose-rtdv3-verify.yaml@main
69     with:
70       GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
71       GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
72       GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
73       GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
74       GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
75       GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
76       GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
77       GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
78       GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
79     secrets:
80       RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
81
82   vote:
83     if: ${{ always() }}
84     # yamllint enable rule:line-length
85     needs: [prepare, rtd-validation]
86     runs-on: ubuntu-latest
87     steps:
88       - name: Get conclusion
89         # yamllint disable-line rule:line-length
90         uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5  # v3.0.3
91       - name: Set vote
92         # yamllint disable-line rule:line-length
93         uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf  # v0.4
94         with:
95           host: ${{ vars.GERRIT_SERVER }}
96           username: ${{ vars.GERRIT_SSH_USER }}
97           key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
98           known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
99           gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
100           gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
101           vote-type: ${{ env.WORKFLOW_CONCLUSION }}
102           comment-only: true