2 name: Gerrit Verify for Ansible roles
4 # yamllint disable-line rule:truthy
9 description: "Branch that change is against"
13 description: "The ID for the change"
17 description: "The Gerrit number"
21 description: "URL to the change"
25 description: "Type of Gerrit event"
28 GERRIT_PATCHSET_NUMBER:
29 description: "The patch number for the change"
32 GERRIT_PATCHSET_REVISION:
33 description: "The revision sha"
37 description: "Project in Gerrit"
41 description: "Gerrit refspec of change"
46 group: ${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }}
47 cancel-in-progress: true
51 runs-on: ubuntu-latest
54 uses: lfit/gerrit-review-action@v0.3
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 }}
63 - name: Allow replication
68 runs-on: ubuntu-latest
70 - uses: lfit/checkout-gerrit-change-action@v0.6
72 gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
74 - name: Download actionlint
76 run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
78 - name: Check workflow files
79 run: ${{ steps.get_actionlint.outputs.executable }} -color
82 # run pre-commit tox env separately to get use of more parallel processing
85 runs-on: ubuntu-latest
87 - uses: lfit/checkout-gerrit-change-action@v0.6
89 gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
91 - uses: actions/setup-python@v4
94 - name: Run static analysis and format checkers
95 run: pipx run pre-commit run --all-files --show-diff-on-failure
100 runs-on: ubuntu-latest
111 - name: Gerrit Checkout
112 # yamllint disable-line rule:line-length
113 uses: lfit/checkout-gerrit-change-action@v0.6
115 gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
117 - name: Install test dependencies.
119 python -m pip install --upgrade pip
120 pip3 install ansible ansible-lint molecule-plugins[docker] docker
121 - name: Run Molecule tests.
123 working-directory: ${{env.working-directory}}
126 ANSIBLE_FORCE_COLOR: "1"
127 MOLECULE_PLATFORM_NAME: ${{ matrix.distro }}
138 runs-on: ubuntu-latest
140 - uses: technote-space/workflow-conclusion-action@v3
142 uses: lfit/gerrit-review-action@v0.3
144 host: ${{ vars.LFIT_GERRIT_SERVER }}
145 username: ${{ vars.LFIT_GERRIT_SSH_USER }}
146 key: ${{ secrets.LFIT_GERRIT_SSH_PRIVKEY_NP }}
147 known_hosts: ${{ vars.LFIT_GERRIT_KNOWN_HOSTS }}
148 gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
149 gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
150 vote-type: ${{ env.WORKFLOW_CONCLUSION }}