CI: Use the tox-verify workflow to test all envs
[releng/global-jjb.git] / .github / workflows / gerrit-verify.yaml
1 ---
2 name: Gerrit 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 concurrency:
46   group: ${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }}
47   cancel-in-progress: true
48
49 jobs:
50   prepare:
51     runs-on: ubuntu-latest
52     steps:
53       - name: Clear votes
54         uses: lfit/gerrit-review-action@v0.5
55         with:
56           host: ${{ vars.LFIT_GERRIT_SERVER }}
57           username: ${{ vars.LFIT_GERRIT_SSH_USER }}
58           key: ${{ secrets.LFIT_GERRIT_SSH_PRIVKEY_NP }}
59           known_hosts: ${{ vars.LFIT_GERRIT_KNOWN_HOSTS }}
60           gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
61           gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
62           vote-type: clear
63       - name: Allow replication
64         run: sleep 10s
65
66   tox-verify:
67     needs: prepare
68     # yamllint disable-line rule:line-length
69     uses: lfit/releng-reusable-workflows/.github/workflows/gerrit-compose-required-tox-verify.yaml@fbf2b4bcca9a6306765f39552d8cfcd962ab6945 # v0.2.1
70     with:
71       GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
72       GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
73       GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
74       GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
75       GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
76       GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
77       GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
78       GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
79       GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
80       # yamllint disable-line rule:line-length
81       TOX_ENVS: '["ensure-documented", "jjb", "jjb-compare-xml", "license", "bashate", "pre-commit", "docs"]'
82
83   vote:
84     if: ${{ always() }}
85     needs: [prepare, pre-commit, tox]
86     runs-on: ubuntu-latest
87     steps:
88       - uses: technote-space/workflow-conclusion-action@v3
89       - name: Set vote
90         uses: lfit/gerrit-review-action@v0.5
91         with:
92           host: ${{ vars.LFIT_GERRIT_SERVER }}
93           username: ${{ vars.LFIT_GERRIT_SSH_USER }}
94           key: ${{ secrets.LFIT_GERRIT_SSH_PRIVKEY_NP }}
95           known_hosts: ${{ vars.LFIT_GERRIT_KNOWN_HOSTS }}
96           gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
97           gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
98           vote-type: ${{ env.WORKFLOW_CONCLUSION }}