Skip to content

Commit

Permalink
CI: Update actions to latest versions
Browse files Browse the repository at this point in the history
* Add actionlint to pre-commit
* Use LF Release Engeinering lint reusable workflow

Signed-off-by: Andrew Grimberg <[email protected]>
Change-Id: I5b5539059c53fdd0cee2734ba83a469b743ddb54
  • Loading branch information
tykeal committed Jun 3, 2024
1 parent 793e37c commit f9e4041
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
56 changes: 29 additions & 27 deletions .github/workflows/gerrit-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ concurrency:


jobs:
prepare:
clear-vote:
runs-on: ubuntu-latest
steps:
- name: Clear votes
uses: lfit/[email protected]
# yamllint disable-line rule:line-length
uses: lfit/gerrit-review-action@9627b9a144f2a2cad70707ddfae87c87dce60729 # v0.8
with:
host: ${{ vars.LFIT_GERRIT_SERVER }}
username: ${{ vars.LFIT_GERRIT_SSH_USER }}
Expand All @@ -62,37 +63,37 @@ jobs:
gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
vote-type: clear
- name: Allow replication
run:
sleep 10s



# run pre-commit tox env separately to get use of more parallel processing
pre-commit:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: lfit/[email protected]
with:
gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
delay: "0s"
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Run static analysis and format checkers
run: pipx run tox -e pre-commit

lint:
needs: clear-vote
# yamllint disable-line rule:line-length
uses: lfit/releng-reusable-workflows/.github/workflows/compose-repo-linting.yaml@main
with:
GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}

tox:
needs: prepare
needs: clear-vote
runs-on: ubuntu-latest
steps:
- uses: lfit/[email protected]
- name: Checkout change
# yamllint disable-line rule:line-length
uses: lfit/checkout-gerrit-change-action@54d751e8bd167bc91f7d665dabe33fae87aaaa63 # v0.9
with:
gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
gerrit-url: ${{ vars.GERRIT_URL }}
delay: "0s"
- uses: actions/setup-python@v4
fetch-depth: 0
- name: Setup Python
# yamllint disable-line rule:line-length
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
id: setup-python
with:
python-version: '3.11'
Expand All @@ -103,14 +104,15 @@ jobs:
vote:
if: ${{ always() }}
needs: [prepare, pre-commit, tox]
needs: [clear-vote, lint, tox]
runs-on: ubuntu-latest
steps:
- name: Get workflow conclusion
# yamllint disable-line rule:line-length
uses: im-open/workflow-conclusion@e4f7c4980600fbe0818173e30931d3550801b992 # v2.2.3
- name: Set vote
uses: lfit/[email protected]
# yamllint disable-line rule:line-length
uses: lfit/gerrit-review-action@9627b9a144f2a2cad70707ddfae87c87dce60729 # v0.8
with:
host: ${{ vars.LFIT_GERRIT_SERVER }}
username: ${{ vars.LFIT_GERRIT_SSH_USER }}
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ repos:
- id: write-good
files: "\\.(rst|md|markdown|mdown|mkdn)$"
exclude: docs/infra/gerrit.rst|docs/best-practices.rst

- repo: https://github.com/rhysd/actionlint
rev: ea8102762106cdca9c88829f1295b39a544706f3 # frozen: v1.6.26
hooks:
- id: actionlint

0 comments on commit f9e4041

Please sign in to comment.