From: Andrew Grimberg Date: Mon, 3 Jun 2024 22:44:09 +0000 (-0700) Subject: CI: Update to latest versions of actions X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=058282aa5bb0df191383bce840962140f32c05f3;p=releng%2Fdocs-conf.git CI: Update to latest versions of actions * Use lint reusable workflow * Cleanup issues raised by actionlint * Add actionlint Signed-off-by: Andrew Grimberg Change-Id: I68ac3f685f0fe5b4792fe8dd6774bd2cfa918ed1 --- diff --git a/.github/workflows/gerrit-verify.yaml b/.github/workflows/gerrit-verify.yaml index 9dc5618..04b3adc 100644 --- a/.github/workflows/gerrit-verify.yaml +++ b/.github/workflows/gerrit-verify.yaml @@ -47,7 +47,7 @@ concurrency: cancel-in-progress: true jobs: - prepare: + clear-vote: runs-on: ubuntu-latest steps: - name: Clear votes @@ -63,31 +63,36 @@ jobs: - 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/checkout-gerrit-change-action@v0.3 - 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/checkout-gerrit-change-action@v0.3 + - 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" - fetch-depth: "0" - - 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" @@ -97,14 +102,15 @@ jobs: vote: if: ${{ always() }} - needs: [prepare, pre-commit, tox] + needs: [clear-vote, lint, tox] runs-on: ubuntu-latest steps: - name: Get workflow conclusion - # yaml-lint disable-line rule:line-length + # yamllint disable-line rule:line-length uses: im-open/workflow-conclusion@e4f7c4980600fbe0818173e30931d3550801b992 # v2.2.3 - name: Set vote - uses: lfit/gerrit-review-action@v0.3 + # 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 }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9cfce1f..25aaddf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,8 +20,8 @@ jobs: pipx run tox -e clean,build - name: Configure TWINE run: | - echo "TWINE_USERNAME=__token__" >> $GITHUB_ENV - echo "TWINE_PASSWORD=${{ secrets.PYPI_API_TOKEN }}" >> $GITHUB_ENV + echo "TWINE_USERNAME=__token__" >> "$GITHUB_ENV" + echo "TWINE_PASSWORD=${{ secrets.PYPI_API_TOKEN }}" >> "$GITHUB_ENV" - name: Publish to PyPI run: >- pipx run tox -e publish -- --repository pypi @@ -29,9 +29,9 @@ jobs: id: tag uses: devops-actions/action-get-tag@v1.0.2 - name: Convert tag - run: >- + run: | VER=$(echo "${{ steps.tag.outputs.tag }}" | tr . -) - echo "ANCHOR=${VER}" >> $GITHUB_ENV + echo "ANCHOR=${VER}" >> "$GITHUB_ENV" - name: Generate reno report run: | # fetch last 30 changes diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7fad379..30b86c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,3 +61,8 @@ repos: rev: v1.0.8 hooks: - id: write-good + + - repo: https://github.com/rhysd/actionlint + rev: ea8102762106cdca9c88829f1295b39a544706f3 # frozen: v1.6.26 + hooks: + - id: actionlint