-
Notifications
You must be signed in to change notification settings - Fork 16
57 lines (54 loc) · 1.59 KB
/
ci.yml
File metadata and controls
57 lines (54 loc) · 1.59 KB
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
name: Test and build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
codeValidation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install uv
run: python -m pip install --upgrade uv
- name: Sync dependencies
run: uv sync --frozen --all-extras
- name: Analysing the code with black
run: |
uv run black $(git rev-parse --show-toplevel) --check
- name: Analysing the code with pylint
run: |
uv run pylint $(git ls-files '*.py')
- name: Check for CRLF line endings
run: |
for file in $(git ls-files); do
if grep -q $'\r$' "$file"; then
echo "$file has faulty file endings"
fi
done
if git grep -I --name-only $'\r'; then
echo "CRLF line endings detected"
exit 1
fi
- name: Analysing the code with flake8
run: |
uv run flake8 $(git rev-parse --show-toplevel)
- name: Analysing the code with isort
run: |
uv run isort --check-only $(git rev-parse --show-toplevel)/ --profile black
- name: Running pytest
working-directory: techsupport_bot
run: |
PYTHONPATH=. uv run pytest tests/ -p no:warnings
containerBuild:
runs-on: ubuntu-latest
needs:
- codeValidation
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: make establish_config && docker build -f Dockerfile . -t techsupportbot:$(date +%s)