-
Notifications
You must be signed in to change notification settings - Fork 21
58 lines (50 loc) · 1.45 KB
/
workflow.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
54
55
56
57
58
name: CI Build
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
- '.vscode/**'
- '.devcontainers/**'
pull_request:
branches:
- master
paths-ignore:
- 'README.md'
- '.vscode/**'
- '.devcontainers/**'
jobs:
build:
runs-on: ubuntu-latest
container: python:3.11-slim
# Required services
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
- name: Linting
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 service tests --count --select=E9,F63,F7,F82 --show-source --statistics
# check for omplexity. The GitHub editor is 127 chars wide
flake8 service tests --count --max-complexity=10 --max-line-length=127 --statistics
# Run pylint on the service and tests folders only
pylint service tests --max-line-length=127
- name: Run unit tests with green
run: green
env:
DATABASE_URI: "redis://redis:6379/0"
RETRY_COUNT: 2
- name: Upload code coverage
uses: codecov/[email protected]