Update unit test workflow to vote

This also includes the license check, so that it does not need to be
run separately.

Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: Ia0595e23821ac379e09ab02d0bd055bfbbc4e301
diff --git a/workflows/verify-unit-tests.yaml b/workflows/verify-unit-tests.yaml
index f944f42..0f85e7d 100644
--- a/workflows/verify-unit-tests.yaml
+++ b/workflows/verify-unit-tests.yaml
@@ -67,7 +67,26 @@
   cancel-in-progress: true
 
 jobs:
+  prepare:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Clear votes
+        # yamllint disable-line rule:line-length
+        uses: lfreleng-actions/gerrit-review-action@537251ec667665b386f70b330b05446e3fc29087 # v0.9
+        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: clear
+          comment-only: ${{ inputs.comment-only }}
+      - name: Allow replication
+        run: sleep 10s
+
   unit-tests:
+    needs: prepare
     runs-on: ubuntu-latest
     strategy:
       matrix:
@@ -94,6 +113,8 @@
         uses: actions/setup-go@v5
         with:
           go-version-file: go.mod
+      - name: Check License Headers
+        uses: ./.github/actions/license-check-action
       - name: Run unit tests
         env:
           DEST_GOPATH: ${{ inputs.DEST_GOPATH }}
@@ -103,3 +124,25 @@
           WORKSPACE: ${{ github.workspace }}
         run: |
           make SHELL="/bin/bash" ${{ matrix.target }}
+
+    vote:
+      if: ${{ always() }}
+      # yamllint enable rule:line-length
+      needs: [prepare, unit-tests]
+      runs-on: ubuntu-latest
+      steps:
+        - name: Get conclusion
+          # yamllint disable-line rule:line-length
+          uses: im-open/workflow-conclusion@e4f7c4980600fbe0818173e30931d3550801b992 # v2.2.3
+        - name: Set vote
+          # yamllint disable-line rule:line-length
+          uses: lfreleng-actions/gerrit-review-action@537251ec667665b386f70b330b05446e3fc29087 # v0.9
+          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: ${{ env.WORKFLOW_CONCLUSION }}
+            comment-only: ${{ inputs.comment-only }}