-
Notifications
You must be signed in to change notification settings - Fork 122
67 lines (54 loc) · 1.89 KB
/
lint_unit_tests.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
name: Lint and Unit Tests
on:
pull_request:
branches: [master]
workflow_dispatch:
concurrency:
group: lint_unit_tests-${{ github.head_ref }}
cancel-in-progress: true
jobs:
lint_and_test:
runs-on: ubuntu-20.04
steps:
- name: Checking out repo
uses: actions/checkout@v4.1.7
- name: Check if python changes are present
id: check
env:
GITHUB_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
continue-on-error: true
run: ./scripts/ci_check_no_file_changes.sh python
- name: Set up Python 3.8
if: steps.check.outcome == 'failure'
uses: actions/setup-python@v5.1.0
with:
python-version: '3.8'
- name: Install dependencies
if: steps.check.outcome == 'failure'
run: make pipelinewise
- name: Check code formatting
if: steps.check.outcome == 'failure'
run: |
. .virtualenvs/pipelinewise/bin/activate
find pipelinewise tests -type f -name '*.py' | xargs unify --check-only
- name: Pylinting
if: steps.check.outcome == 'failure'
run: |
. .virtualenvs/pipelinewise/bin/activate
pylint pipelinewise tests
- name: Pep8
if: steps.check.outcome == 'failure'
run: |
. .virtualenvs/pipelinewise/bin/activate
flake8 pipelinewise --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Pep8 complexity
if: steps.check.outcome == 'failure'
run: |
. .virtualenvs/pipelinewise/bin/activate
flake8 pipelinewise --count --max-complexity=15 --max-line-length=120 --statistics
- name: Run Unit tests
if: steps.check.outcome == 'failure'
run: |
. .virtualenvs/pipelinewise/bin/activate
pytest --cov=pipelinewise --cov-fail-under=77 -v tests/units