-
Notifications
You must be signed in to change notification settings - Fork 0
182 lines (153 loc) Β· 4.59 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Lint
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_call:
workflow_dispatch:
jobs:
lint-commits:
runs-on: ubuntu-22.04
if: github.actor != 'dependabot[bot]'
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check commits
uses: wagoid/commitlint-github-action@v6
lint-markdown:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Lint markdown files
uses: avto-dev/[email protected]
with:
args: "**/*.md"
ignore: "./CHANGELOG.md"
lint-yaml:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Lint yaml files
uses: ibiqlik/[email protected]
lint-ontology:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Find changed ttl files
id: changed-ttl-files
uses: tj-actions/[email protected]
with:
files: |
src/**/*.ttl
test/**/*.ttl
example/**/*.ttl
Makefile
- name: Validate rdf files (turtle)
if: steps.changed-ttl-files.outputs.any_changed == 'true'
run: |
make lint-ttl
- name: Check rdf files (turtle) are formatted
if: steps.changed-ttl-files.outputs.any_changed == 'true'
run: |
make format-ttl
if [[ $(git status -s) ]]; then
>&2 echo "β There is a diff between formatted files and source code"
>&2 git status
exit 1
fi
lint-generated:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Generate documentation
run: |
find docs -type f -name "*.md" -exec chmod 666 {} +
make docs
env:
NUMBER_OF_THE_BEAST: 666
- name: Check Git diff in generated files (proto + docs)
run: |
if [[ $(git status -s) != "" ]]; then
>&2 echo "β There is a diff between generated files and source code"
>&2 git status
exit 1
fi
lint-poetry:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if poetry files have changed
id: changed-poetry-files
uses: tj-actions/[email protected]
with:
files: |
script/poetry.lock
script/pyproject.toml
- name: Install Python
if: steps.changed-poetry-files.outputs.any_changed == 'true'
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Python Poetry
if: steps.changed-poetry-files.outputs.any_changed == 'true'
uses: abatilo/[email protected]
with:
poetry-version: 1.7.1
- name: Check poetry config is valid
if: steps.changed-poetry-files.outputs.any_changed == 'true'
working-directory: script
run: |
poetry check
lint-python:
needs: lint-poetry
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if python files have changed
id: changed-python-files
uses: tj-actions/[email protected]
with:
files: |
script/**/*.*
- name: Install Python
if: steps.changed-python-files.outputs.any_changed == 'true'
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Python Poetry
if: steps.changed-python-files.outputs.any_changed == 'true'
uses: abatilo/[email protected]
with:
poetry-version: 1.7.1
- name: Install project dependencies
if: steps.changed-python-files.outputs.any_changed == 'true'
working-directory: script
run: |
poetry install
- name: Lint python code (flake8)
if: steps.changed-python-files.outputs.any_changed == 'true'
working-directory: script
run: |
poetry run flake8 --count --show-source --statistics
- name: Lint python code (mypy)
if: steps.changed-python-files.outputs.any_changed == 'true'
working-directory: script
run: |
poetry run mypy --config-file ./mypy.ini .