-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.7 KB
/
Copy pathpython-app.yml
File metadata and controls
57 lines (54 loc) · 1.7 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: build
on:
push:
branches: [ prod ]
pull_request:
branches: [ prod ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r binge-companion-data-api/requirements-dev.txt
- name: Lint with flake8
run: |
# Stops the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Start Tests with coverage
env:
RDB_USER: postgres
RDB_PASSWORD: postgres
RDB_HOST: localhost
RDB_DATABASE_NAME: postgres
run: |
pytest --cov=.
coverage lcov --omit="*/usr/lib/*","*/tests/*"
working-directory: binge-companion-data-api/
- name: Publish coverage to coveralls.io
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ github.token }}
path-to-lcov: binge-companion-data-api/coverage.lcov
base-path: binge-companion-data-api/