-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (62 loc) · 1.85 KB
/
build-test.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
# This workflow will install the package and dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package build and test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "flit>=2,<4"
flit install --deps=all
- name: Lint with flake8
if: always()
run: |
flake8 .
- name: mypy
if: always()
run: |
mypy pitci/
- name: Lint with black
if: always()
run: |
black --version
black --check .
- name: Test with pytest
if: always()
run: |
pytest . --cov=pitci/ --cov-report=html --cov-report=xml --cov-config=.coveragerc
- name: Upload coverage pytest html test results to github
if: always()
uses: actions/upload-artifact@v2
with:
name: coverage-html-pytest-results
path: htmlcov
- name: Upload coverage pytest html test results to codacy
if: always()
run: |
export CODACY_PROJECT_TOKEN=${{secrets.CODACY_PROJECT_TOKEN}}
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml
- name: Run Bandit tests
if: always()
run: |
bandit -r pitci -f html -o bandit-test-results.html
- name: Upload bandit test results
if: always()
uses: actions/upload-artifact@v2
with:
name: bandit-results
path: bandit-test-results.html