-
Notifications
You must be signed in to change notification settings - Fork 16
63 lines (60 loc) · 1.76 KB
/
ci.yml
File metadata and controls
63 lines (60 loc) · 1.76 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
58
59
60
61
62
63
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 pip
run: |
python -m pip install pip==$(sed -nE 's/pip = "==(.*)"/\1/p' Pipfile)
- name: Install pipenv
run: |
PIPENV_VERSION=$(sed -nE 's/pipenv = "==(.*)"/\1/p' Pipfile)
python -m pip install pipenv==$PIPENV_VERSION
- name: Install from pipfile
run: |
pipenv install --system
- name: Analysing the code with black
run: |
black $(git rev-parse --show-toplevel) --check
- name: Analysing the code with pylint
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: |
flake8 $(git rev-parse --show-toplevel)
- name: Analysing the code with isort
run: |
isort --check-only $(git rev-parse --show-toplevel)/ --profile black
- name: Running pytest
run: |
cd techsupport_bot
python3.11 -m 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)