-
Notifications
You must be signed in to change notification settings - Fork 23
53 lines (46 loc) · 1.26 KB
/
ci.yaml
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
name: CI Build
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
pull_request:
branches:
- master
paths-ignore:
- 'README.md'
jobs:
build:
runs-on: ubuntu-latest
container: python:3.11-slim
# Required services
services:
redis:
image: redis:6-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip poetry
poetry config virtualenvs.create false
poetry install
- name: Linting
run: |
flake8 service --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 service --count --max-complexity=10 --max-line-length=127 --statistics
pylint service --max-line-length=127
- name: Run unit tests with PyTest
run: pytest --pspec --cov=service --cov-fail-under=95
env:
DATABASE_URI: "redis://redis:6379"
- name: Upload code coverage
uses: codecov/[email protected]