|
1 | 1 | # This file is part of CERN Open Data Portal.
|
2 |
| -# Copyright (C) 2020, 2023, 2024 CERN. |
| 2 | +# Copyright (C) 2020, 2023, 2024, 2025 CERN. |
3 | 3 | #
|
4 | 4 | # CERN Open Data Portal is free software; you can redistribute it
|
5 | 5 | # and/or modify it under the terms of the GNU General Public License as
|
|
20 | 20 | # waive the privileges and immunities granted to it by virtue of its status
|
21 | 21 | # as an Intergovernmental Organization or submit itself to any jurisdiction.
|
22 | 22 |
|
23 |
| -name: CI |
| 23 | +name: ci |
24 | 24 |
|
25 | 25 | on: [push, pull_request]
|
26 | 26 |
|
27 | 27 | jobs:
|
28 |
| - lint-shellcheck: |
29 |
| - runs-on: ubuntu-20.04 |
| 28 | + data-dois: |
| 29 | + runs-on: ubuntu-24.04 |
| 30 | + steps: |
| 31 | + - name: Checkout |
| 32 | + uses: actions/checkout@v4 |
| 33 | + |
| 34 | + - name: Setup node |
| 35 | + uses: actions/setup-node@v4 |
| 36 | + |
| 37 | + - name: Check data DOIs |
| 38 | + run: ./run-tests.sh --data-dois |
| 39 | + |
| 40 | + data-json: |
| 41 | + runs-on: ubuntu-24.04 |
30 | 42 | steps:
|
31 | 43 | - name: Checkout
|
32 |
| - uses: actions/checkout@v2 |
| 44 | + uses: actions/checkout@v4 |
33 | 45 |
|
34 |
| - - name: Runs shell script static analysis |
| 46 | + - name: Setup Python |
| 47 | + uses: actions/setup-python@v5 |
| 48 | + with: |
| 49 | + python-version: 3.9 |
| 50 | + |
| 51 | + - name: Check data JSON |
35 | 52 | run: |
|
36 |
| - sudo apt-get install shellcheck |
37 |
| - ./run-tests.sh --check-shellscript |
| 53 | + pip install click |
| 54 | + ./run-tests.sh --data-json |
38 | 55 |
|
39 |
| - lint-black: |
40 |
| - runs-on: ubuntu-20.04 |
| 56 | + data-licenses: |
| 57 | + runs-on: ubuntu-24.04 |
41 | 58 | steps:
|
42 |
| - - uses: actions/checkout@v2 |
| 59 | + - name: Checkout |
| 60 | + uses: actions/checkout@v4 |
43 | 61 |
|
44 | 62 | - name: Setup Python
|
45 |
| - uses: actions/setup-python@v2 |
| 63 | + uses: actions/setup-python@v5 |
46 | 64 | with:
|
47 | 65 | python-version: 3.9
|
48 | 66 |
|
49 |
| - - name: Check Python code formatting |
| 67 | + - name: Check data licenses |
50 | 68 | run: |
|
51 |
| - pip install black |
52 |
| - ./run-tests.sh --check-black |
| 69 | + ./run-tests.sh --data-licenses |
| 70 | +
|
| 71 | + data-recids: |
| 72 | + runs-on: ubuntu-24.04 |
| 73 | + steps: |
| 74 | + - name: Checkout |
| 75 | + uses: actions/checkout@v4 |
| 76 | + |
| 77 | + - name: Setup node |
| 78 | + uses: actions/setup-node@v4 |
53 | 79 |
|
54 |
| - lint-pycodestyle: |
55 |
| - runs-on: ubuntu-20.04 |
| 80 | + - name: Check data record IDs |
| 81 | + run: ./run-tests.sh --data-recids |
| 82 | + |
| 83 | + data-slugs: |
| 84 | + runs-on: ubuntu-24.04 |
| 85 | + steps: |
| 86 | + - name: Checkout |
| 87 | + uses: actions/checkout@v4 |
| 88 | + |
| 89 | + - name: Setup node |
| 90 | + uses: actions/setup-node@v4 |
| 91 | + |
| 92 | + - name: Check data slugs |
| 93 | + run: ./run-tests.sh --data-slugs |
| 94 | + |
| 95 | + data-types: |
| 96 | + runs-on: ubuntu-24.04 |
56 | 97 | steps:
|
57 | 98 | - name: Checkout
|
58 |
| - uses: actions/checkout@v2 |
| 99 | + uses: actions/checkout@v4 |
| 100 | + |
| 101 | + - name: Setup node |
| 102 | + uses: actions/setup-node@v4 |
| 103 | + |
| 104 | + - name: Check data types |
| 105 | + run: ./run-tests.sh --data-types |
| 106 | + |
| 107 | + format-black: |
| 108 | + runs-on: ubuntu-24.04 |
| 109 | + steps: |
| 110 | + - name: Checkout |
| 111 | + uses: actions/checkout@v4 |
59 | 112 |
|
60 | 113 | - name: Setup Python
|
61 |
| - uses: actions/setup-python@v2 |
| 114 | + uses: actions/setup-python@v5 |
62 | 115 | with:
|
63 | 116 | python-version: 3.9
|
64 | 117 |
|
65 |
| - - name: Check compliance with Python coding style conventions |
| 118 | + - name: Check formatting of Python code |
66 | 119 | run: |
|
67 |
| - pip install --upgrade pip |
68 |
| - pip install pycodestyle |
69 |
| - ./run-tests.sh --check-pycodestyle |
| 120 | + pip install black |
| 121 | + ./run-tests.sh --format-black |
70 | 122 |
|
71 |
| - lint-pydocstyle: |
72 |
| - runs-on: ubuntu-20.04 |
| 123 | + format-isort: |
| 124 | + runs-on: ubuntu-24.04 |
73 | 125 | steps:
|
74 | 126 | - name: Checkout
|
75 |
| - uses: actions/checkout@v2 |
| 127 | + uses: actions/checkout@v4 |
76 | 128 |
|
77 | 129 | - name: Setup Python
|
78 |
| - uses: actions/setup-python@v2 |
| 130 | + uses: actions/setup-python@v5 |
79 | 131 | with:
|
80 | 132 | python-version: 3.9
|
81 | 133 |
|
82 |
| - - name: Check compliance with Python docstring conventions |
| 134 | + - name: Check formatting of Python imports |
83 | 135 | run: |
|
84 |
| - pip install --upgrade pip |
85 |
| - pip install pydocstyle |
86 |
| - ./run-tests.sh --check-pydocstyle |
| 136 | + pip install isort |
| 137 | + ./run-tests.sh --format-isort |
| 138 | +
|
| 139 | + format-shfmt: |
| 140 | + runs-on: ubuntu-24.04 |
| 141 | + steps: |
| 142 | + - name: Checkout |
| 143 | + uses: actions/checkout@v4 |
| 144 | + |
| 145 | + - name: Check formatting of shell scripts |
| 146 | + run: | |
| 147 | + sudo apt-get install shfmt |
| 148 | + ./run-tests.sh --format-shfmt |
87 | 149 |
|
88 |
| - check-fixtures: |
89 |
| - runs-on: ubuntu-20.04 |
| 150 | + format-whitespace: |
| 151 | + runs-on: ubuntu-24.04 |
90 | 152 | steps:
|
91 | 153 | - name: Checkout
|
92 |
| - uses: actions/checkout@v2 |
| 154 | + uses: actions/checkout@v4 |
93 | 155 |
|
94 | 156 | - name: Setup node
|
95 |
| - uses: actions/setup-node@v1 |
| 157 | + uses: actions/setup-node@v4 |
| 158 | + |
| 159 | + - name: Check formatting of whitespace |
| 160 | + run: ./run-tests.sh --format-whitespace |
| 161 | + |
| 162 | + lint-commitlint: |
| 163 | + runs-on: ubuntu-24.04 |
| 164 | + steps: |
| 165 | + - name: Checkout |
| 166 | + uses: actions/checkout@v4 |
96 | 167 | with:
|
97 |
| - node-version: "14" |
| 168 | + fetch-depth: 0 |
98 | 169 |
|
99 |
| - - name: Install Node dependencies |
100 |
| - run: npm install -g jsonlint |
| 170 | + - name: Setup Node |
| 171 | + uses: actions/setup-node@v4 |
101 | 172 |
|
102 |
| - - name: Check fixtures |
103 |
| - run: ./run-tests.sh --check-fixtures |
| 173 | + - name: Install commitlint |
| 174 | + run: | |
| 175 | + npm install conventional-changelog-conventionalcommits |
| 176 | + npm install commitlint@latest |
| 177 | +
|
| 178 | + - name: Check commit message compliance of the recently pushed commit |
| 179 | + if: github.event_name == 'push' |
| 180 | + run: | |
| 181 | + ./run-tests.sh --lint-commitlint HEAD~1 HEAD |
104 | 182 |
|
105 |
| - check-isort: |
106 |
| - runs-on: ubuntu-20.04 |
| 183 | + - name: Check commit message compliance of the pull request |
| 184 | + if: github.event_name == 'pull_request' |
| 185 | + run: | |
| 186 | + ./run-tests.sh --lint-commitlint ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.number }} |
| 187 | +
|
| 188 | + lint-flake8: |
| 189 | + runs-on: ubuntu-24.04 |
107 | 190 | steps:
|
108 |
| - - name: Checkout |
109 |
| - uses: actions/checkout@v2 |
| 191 | + - uses: actions/checkout@v4 |
110 | 192 |
|
111 | 193 | - name: Setup Python
|
112 |
| - uses: actions/setup-python@v2 |
| 194 | + uses: actions/setup-python@v5 |
113 | 195 | with:
|
114 | 196 | python-version: 3.9
|
115 | 197 |
|
116 |
| - - name: Check isort |
| 198 | + - name: Check linting of Python code |
117 | 199 | run: |
|
118 |
| - pip install --upgrade pip |
119 |
| - pip install isort |
120 |
| - ./run-tests.sh --check-isort |
| 200 | + pip install flake8 |
| 201 | + ./run-tests.sh --lint-flake8 |
| 202 | +
|
| 203 | + lint-jsonlint: |
| 204 | + runs-on: ubuntu-24.04 |
| 205 | + steps: |
| 206 | + - name: Checkout |
| 207 | + uses: actions/checkout@v4 |
| 208 | + |
| 209 | + - name: Setup Node |
| 210 | + uses: actions/setup-node@v4 |
| 211 | + |
| 212 | + - name: Check linting of JSON files |
| 213 | + run: | |
| 214 | + npm install jsonlint --global |
| 215 | + ./run-tests.sh --lint-jsonlint |
121 | 216 |
|
122 |
| - check-licenses: |
123 |
| - runs-on: ubuntu-20.04 |
| 217 | + lint-pydocstyle: |
| 218 | + runs-on: ubuntu-24.04 |
124 | 219 | steps:
|
125 | 220 | - name: Checkout
|
126 |
| - uses: actions/checkout@v2 |
| 221 | + uses: actions/checkout@v4 |
127 | 222 |
|
128 | 223 | - name: Setup Python
|
129 |
| - uses: actions/setup-python@v2 |
| 224 | + uses: actions/setup-python@v5 |
130 | 225 | with:
|
131 | 226 | python-version: 3.9
|
132 | 227 |
|
133 |
| - - name: Check licenses |
| 228 | + - name: Check linting of Python docstrings |
| 229 | + run: | |
| 230 | + pip install pydocstyle |
| 231 | + ./run-tests.sh --lint-pydocstyle |
| 232 | +
|
| 233 | + lint-shellcheck: |
| 234 | + runs-on: ubuntu-24.04 |
| 235 | + steps: |
| 236 | + - name: Checkout |
| 237 | + uses: actions/checkout@v4 |
| 238 | + |
| 239 | + - name: Check linting of shell scripts |
| 240 | + run: | |
| 241 | + sudo apt-get install shellcheck |
| 242 | + ./run-tests.sh --lint-shellcheck |
| 243 | +
|
| 244 | + lint-yamllint: |
| 245 | + runs-on: ubuntu-24.04 |
| 246 | + steps: |
| 247 | + - name: Checkout |
| 248 | + uses: actions/checkout@v4 |
| 249 | + with: |
| 250 | + fetch-depth: 0 |
| 251 | + |
| 252 | + - name: Setup Python |
| 253 | + uses: actions/setup-python@v5 |
| 254 | + with: |
| 255 | + python-version: "3.12" |
| 256 | + |
| 257 | + - name: Lint YAML files |
134 | 258 | run: |
|
135 |
| - pip install --upgrade pip |
136 |
| - ./run-tests.sh --check-licenses |
| 259 | + pip install yamllint |
| 260 | + ./run-tests.sh --lint-yamllint |
0 commit comments