|
1 |
| -name: GH Actions |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | pull_request:
|
5 | 5 | branches: [ master ]
|
6 | 6 | workflow_dispatch:
|
7 | 7 |
|
8 | 8 | jobs:
|
9 |
| - |
10 |
| - python-style-check: |
11 |
| - |
| 9 | + python-sanity-check: |
12 | 10 | name: Python ${{ matrix.python-version }}
|
13 |
| - runs-on: ubuntu-20.04 |
14 |
| - |
| 11 | + runs-on: ubuntu-24.04 |
15 | 12 | strategy:
|
16 | 13 | matrix:
|
17 |
| - python-version: [3.6, 3.9] |
| 14 | + python-version: [3.9, 3.12] |
18 | 15 | fail-fast: false
|
19 |
| - |
20 | 16 | steps:
|
21 | 17 | - run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}"
|
22 | 18 | - name: Check out repository code
|
23 |
| - uses: actions/checkout@v3 |
| 19 | + uses: actions/checkout@v4 |
24 | 20 | with:
|
25 | 21 | fetch-depth: 0
|
26 | 22 | - name: Set up Python ${{ matrix.python-version }}
|
27 |
| - uses: actions/setup-python@v4 |
| 23 | + uses: actions/setup-python@v5 |
28 | 24 | with:
|
29 | 25 | python-version: ${{ matrix.python-version }}
|
30 |
| - - name: Install dependencies |
31 |
| - run: | |
32 |
| - pip install sphinx |
33 |
| - pip install -r requirements-ci.txt |
34 |
| - - name: Run inspekt |
35 |
| - if: ${{ matrix.python-version > 3.6 }} |
36 |
| - run: inspekt checkall --disable-style E203,E501,E265,W601,E402,E722,E741 --disable-lint=W,R,C,E0601,E1002,E1101,E1103,E1120,F0401,I0011,I1101 --enable-lint W0611,W1201 --no-license-check |
37 |
| - - name: Run inspekt (py36) |
38 |
| - if: ${{ matrix.python-version == 3.6 }} |
39 |
| - run: inspekt checkall --disable-style E203,E501,E265,W601,E402,E722,E741 --disable-lint=W,R,C,E0012,E0601,E1002,E1101,E1103,E1120,F0401,I0011,I1101 --enable-lint W0611,W1201 --no-license-check |
| 26 | + - name: Install pylint |
| 27 | + run: pip install pylint |
| 28 | + - name: Run pylint |
| 29 | + run: pylint . |
40 | 30 | - run: echo "This job's status is ${{ job.status }}."
|
41 | 31 |
|
42 | 32 | commitlint:
|
43 |
| - |
44 |
| - name: Commit lint |
45 |
| - runs-on: ubuntu-20.04 |
46 |
| - |
| 33 | + name: Commitlint |
| 34 | + runs-on: ubuntu-24.04 |
47 | 35 | steps:
|
48 | 36 | - name: Check out repository code
|
49 |
| - uses: actions/checkout@v3 |
| 37 | + uses: actions/checkout@v4 |
50 | 38 | with:
|
51 | 39 | fetch-depth: 0
|
52 | 40 | - name: Lint commit messages
|
53 |
| - uses: wagoid/commitlint-github-action@v5 |
| 41 | + uses: wagoid/commitlint-github-action@v6 |
54 | 42 | with:
|
55 |
| - configFile: ./.ci/commitlint.config.ts |
| 43 | + configFile: commitlint.config.mjs |
56 | 44 | helpURL: https://avocado-framework.readthedocs.io/en/latest/guides/contributor/chapters/styleguides.html#commit-style-guide
|
57 | 45 |
|
58 | 46 | pr-check:
|
59 |
| - |
60 | 47 | name: PR title
|
61 |
| - runs-on: ubuntu-20.04 |
62 |
| - |
| 48 | + runs-on: ubuntu-24.04 |
63 | 49 | steps:
|
64 |
| - - name: Check title length of pull request(${{github.event.pull_request.number}}) |
65 |
| - run: | |
66 |
| - if [ $(echo "${{ github.event.pull_request.title }}" | wc -L) -gt 72 ]; then |
67 |
| - echo "Title of pull request(${{github.event.pull_request.number}}) is longer than 72 characters" |
68 |
| - exit 1 |
69 |
| - fi |
70 |
| -
|
71 |
| - cfg-lint-check: |
72 |
| - |
73 |
| - name: Cfg lint |
74 |
| - runs-on: ubuntu-20.04 |
| 50 | + - name: Check title length of pull request |
| 51 | + uses: actions/github-script@v7 |
| 52 | + with: |
| 53 | + script: | |
| 54 | + const title = context.payload.pull_request.title; |
| 55 | + const prNumber = context.payload.pull_request.number; |
| 56 | + const titleLength = title.length; |
| 57 | +
|
| 58 | + console.log(`Current title length for pull request(#${prNumber}): ${titleLength}`); |
| 59 | + if (titleLength > 72) { |
| 60 | + core.setFailed(`Title of pull request(#${prNumber}) is longer than 72 characters`); |
| 61 | + } |
| 62 | +
|
| 63 | + changed-cfg-files: |
| 64 | + name: Changed cfg files |
| 65 | + runs-on: ubuntu-24.04 |
75 | 66 | outputs:
|
76 |
| - matrix: ${{ steps.set-matrix.outputs.matrix }} |
77 |
| - |
| 67 | + matrix: ${{ steps.cfg-files.outputs.all_changed_files }} |
78 | 68 | steps:
|
79 | 69 | - name: Check out repository code
|
80 |
| - uses: actions/checkout@v3 |
| 70 | + uses: actions/checkout@v4 |
81 | 71 | with:
|
82 | 72 | fetch-depth: 0
|
83 |
| - - name: Get changed files |
| 73 | + - name: Detect changed cfg files |
84 | 74 | id: cfg-files
|
85 |
| - uses: tj-actions/changed-files@v35 |
| 75 | + uses: tj-actions/changed-files@v46 |
86 | 76 | with:
|
87 |
| - files: | |
88 |
| - */tests/cfg/*.cfg |
89 |
| - - name: Set matrix |
90 |
| - id: set-matrix |
91 |
| - run: echo matrix=$(python3 -c 'print("${{ steps.cfg-files.outputs.all_changed_files }}".split())') >> $GITHUB_OUTPUT |
92 |
| - - name: Check cfg files lint |
93 |
| - if: steps.cfg-files.outputs.any_changed == 'true' |
94 |
| - run: | |
95 |
| - ./.ci/cfg-lint-check.py ${{ steps.cfg-files.outputs.all_changed_files }} |
| 77 | + files: "*/tests/cfg/*.cfg" |
| 78 | + matrix: true |
96 | 79 |
|
97 | 80 | cartesian-syntax-check:
|
98 |
| - |
99 | 81 | name: Cartesian syntax
|
100 |
| - runs-on: ubuntu-20.04 |
101 |
| - needs: cfg-lint-check |
102 |
| - if: ${{ needs.cfg-lint-check.outputs.matrix != '[]' }} |
| 82 | + runs-on: ubuntu-24.04 |
| 83 | + if: ${{ needs.changed-cfg-files.outputs.matrix != '[]' }} |
| 84 | + needs: changed-cfg-files |
103 | 85 | strategy:
|
104 | 86 | matrix:
|
105 |
| - file: ${{ fromJson(needs.cfg-lint-check.outputs.matrix) }} |
| 87 | + file: ${{ fromJSON(needs.changed-cfg-files.outputs.matrix) }} |
106 | 88 | fail-fast: false
|
107 |
| - |
108 | 89 | steps:
|
109 | 90 | - name: Check out repository code
|
110 |
| - uses: actions/checkout@v3 |
| 91 | + uses: actions/checkout@v4 |
111 | 92 | with:
|
112 | 93 | fetch-depth: 0
|
113 |
| - - name: Parse ${{ matrix.file }} into Cartesian configuration |
| 94 | + - name: Parse file into Cartesian configuration |
114 | 95 | env:
|
115 | 96 | CFG_FILE: ${{ matrix.file }}
|
116 | 97 | run: |
|
117 |
| - echo "Parse ${CFG_FILE} into Cartesian configuration" |
118 |
| - sed -i '1s/^/variants:\n/' ${CFG_FILE} |
119 |
| - curl -fsSL https://raw.githubusercontent.com/avocado-framework/avocado-vt/master/virttest/cartesian_config.py | python3 - -f ${CFG_FILE} |
| 98 | + echo "Parsing ${CFG_FILE} into Cartesian configuration" |
| 99 | + sed -i '1s/^/variants:\n/' "${CFG_FILE}" |
| 100 | + curl -fsSL https://raw.githubusercontent.com/avocado-framework/avocado-vt/master/virttest/cartesian_config.py | python3 - -f "${CFG_FILE}" |
0 commit comments