forked from serum-community/pyserum
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (63 loc) · 2.4 KB
/
main.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [alpha, master]
pull_request:
branches: [alpha, master]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install pipenv
uses: dschep/install-pipenv-action@v1
- name: Install CI dependencies
run: |
pipenv run install-ci-deps
- name: Run linters
run: |
pipenv run black --check --diff --line-length=120 setup.py pyserum tests
pipenv run pylint --rcfile=.pylintrc setup.py pyserum tests
pipenv run flake8 setup.py pyserum tests
pipenv run mypy pyserum
- name: Run unit tests
run: |
pipenv run pytest -v -m "not integration and not async_integration"
coverage:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install pipenv
uses: dschep/install-pipenv-action@v1
- name: Generate coverage report
run: |
pipenv install --dev --skip-lock pytest pytest-cov
scripts/run_coverage.sh
- name: Upload coverage to Codecov
# You may pin to the exact commit or the version.
# uses: codecov/codecov-action@6004246f47ab62d32be025ce173b241cd84ac58e
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
# Path to coverage file to upload
file: ./coverage.xml
env_vars: OS,PYTHON
# Specify whether or not CI build should fail if Codecov runs into an error during upload
fail_ci_if_error: true