Skip to content

Commit

Permalink
CI: Optimize GHA verify job
Browse files Browse the repository at this point in the history
Issue: RELENG-4563
Signed-off-by: Andrew Grimberg <[email protected]>
Change-Id: I6410121b35edf484a476ae0438c86fc8fbca2d28
  • Loading branch information
tykeal committed Apr 12, 2023
1 parent 984bce4 commit 294e08d
Showing 1 changed file with 66 additions and 8 deletions.
74 changes: 66 additions & 8 deletions .github/workflows/gerrit-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ concurrency:
cancel-in-progress: true

jobs:
prepare:
clear-vote:
runs-on: ubuntu-latest
outputs:
wheel-distribution: ${{ steps.wheel-distribution.outputs.path }}
steps:
- name: Clear votes
uses: lfit/[email protected]
Expand All @@ -62,6 +60,14 @@ jobs:
gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
vote-type: clear


prepare:
needs: clear-vote
runs-on: ubuntu-latest
outputs:
wheel-distribution: ${{ steps.wheel-distribution.outputs.path }}
steps:
- name: Checkout change
uses: lfit/[email protected]
with:
Expand All @@ -70,8 +76,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Run static analysis and format checkers
run: pipx run pre-commit run --all-files --show-diff-on-failure
- name: Build package distribution files
run: >-
pipx run tox -e clean,build
Expand All @@ -87,6 +91,20 @@ jobs:
path: dist/
retention-days: 1

pre-commit:
needs: clear-vote
runs-on: ubuntu-latest
- name: Checkout change
uses: lfit/[email protected]
with:
gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
- name: Configure Python
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Run static analysis and format checkers
run: pipx run pre-commit run --all-files --show-diff-on-failure

test:
needs: prepare
runs-on: ubuntu-latest
Expand Down Expand Up @@ -119,8 +137,9 @@ jobs:
tox --installpkg '${{ needs.prepare.outputs.wheel-distribution }}'
-- -rFEx --durations 10 --color yes # pytest args
docs:
needs: prepare
needs: clear-vote
runs-on: ubuntu-latest
steps:
- name: Checkout change
Expand All @@ -136,11 +155,50 @@ jobs:
python-version: "3.7"
- name: Run docs tests
run: >-
pipx run tox -e docs,docs-linkcheck,license
pipx run tox -e docs
docs-linkcheck:
needs: clear-vote
runs-on: ubuntu-latest
steps:
- name: Checkout change
uses: lfit/[email protected]
with:
gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
delay: "0s"
fetch-depth: "0"
- name: Configure Python
uses: actions/setup-python@v4
id: setup-python
with:
python-version: "3.7"
- name: Run docs-linkcheck tests
run: >-
pipx run tox -e docs-linkcheck
license:
needs: clear-vote
runs-on: ubuntu-latest
steps:
- name: Checkout change
uses: lfit/[email protected]
with:
gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
delay: "0s"
fetch-depth: "0"
- name: Configure Python
uses: actions/setup-python@v4
id: setup-python
with:
python-version: "3.7"
- name: Run license tests
run: >-
pipx run tox -e license
vote:
if: ${{ always() }}
needs: [prepare, test, docs]
needs: [prepare, pre-commit, test, docs, docs-linkcheck, license]
runs-on: ubuntu-latest
steps:
- name: Get workflow conclusion
Expand Down

0 comments on commit 294e08d

Please sign in to comment.