[pre-commit.ci] pre-commit autoupdate #8114
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
python-sanity-check: | |
name: Python ${{ matrix.python-version }} | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
python-version: [3.9, 3.12] | |
fail-fast: false | |
steps: | |
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}" | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pylint | |
run: pip install pylint | |
- name: Run pylint | |
run: pylint . | |
- run: echo "This job's status is ${{ job.status }}." | |
commitlint: | |
name: Commitlint | |
runs-on: ubuntu-24.04 | |
# Skip if it's a PR from a bot account | |
if: github.event.pull_request.user.type != 'Bot' | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Lint commit messages | |
uses: wagoid/commitlint-github-action@v6 | |
with: | |
configFile: commitlint.config.mjs | |
helpURL: https://avocado-framework.readthedocs.io/en/latest/guides/contributor/chapters/styleguides.html#commit-style-guide | |
pr-check: | |
name: PR title | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check title length of pull request | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const title = context.payload.pull_request.title; | |
const prNumber = context.payload.pull_request.number; | |
const titleLength = title.length; | |
console.log(`Current title length for pull request(#${prNumber}): ${titleLength}`); | |
if (titleLength > 72) { | |
core.setFailed(`Title of pull request(#${prNumber}) is longer than 72 characters`); | |
} | |
changed-cfg-files: | |
name: Changed cfg files | |
runs-on: ubuntu-24.04 | |
outputs: | |
matrix: ${{ steps.cfg-files.outputs.all_changed_files }} | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Detect changed cfg files | |
id: cfg-files | |
uses: tj-actions/changed-files@v46 | |
with: | |
files: "*/tests/cfg/*.cfg" | |
matrix: true | |
cartesian-syntax-check: | |
name: Cartesian syntax | |
runs-on: ubuntu-24.04 | |
if: ${{ needs.changed-cfg-files.outputs.matrix != '[]' }} | |
needs: changed-cfg-files | |
strategy: | |
matrix: | |
file: ${{ fromJSON(needs.changed-cfg-files.outputs.matrix) }} | |
fail-fast: false | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Parse file into Cartesian configuration | |
env: | |
CFG_FILE: ${{ matrix.file }} | |
run: | | |
echo "Parsing ${CFG_FILE} into Cartesian configuration" | |
sed -i '1s/^/variants:\n/' "${CFG_FILE}" | |
curl -fsSL https://raw.githubusercontent.com/avocado-framework/avocado-vt/master/virttest/cartesian_config.py | python3 - -f "${CFG_FILE}" |