-
Notifications
You must be signed in to change notification settings - Fork 65
73 lines (73 loc) · 2.3 KB
/
code_check.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Code Check
on:
push:
branches:
- main
pull_request:
jobs:
linux_check:
name: Code Check on Linux
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install black
run: pip install black
- name: Run black test
run: black --check .
- name: Install isort
run: pip install isort
- name: Run isort test
run: isort --profile=black --check *.py
- name: Install flake8
run: pip install flake8
- name: Run flake8 test
run: flake8 *.py
- name: Install coverage
run: pip install coverage html2text
- name: Install required dependencies
run: pip install PyYAML
- name: Run unit tests
run: python3 -m coverage run -m unittest yaml_parser.py invoke_process.py smallfile.py
- name: Collect coverage report
run: |
python3 -m coverage html
- name: Publish coverage report to job summary
run: html2text --ignore-images --ignore-links -b 0 htmlcov/index.html >> $GITHUB_STEP_SUMMARY
- name: Upload coverage results
uses: actions/upload-artifact@v3
with:
name: coverage
path: htmlcov
if-no-files-found: error
windows:
name: Code Check on Windows
runs-on: windows-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install coverage
run: pip install coverage html2text
- name: Install required dependencies
run: pip install PyYAML
- name: Run unit tests
run: python3 -m coverage run -m unittest yaml_parser.py invoke_process.py smallfile.py
- name: Collect coverage report
run: |
python3 -m coverage html
- name: Publish coverage report to job summary
run: html2text --ignore-images --ignore-links -b 0 htmlcov/index.html >> $env:GITHUB_STEP_SUMMARY
- name: Upload coverage results
uses: actions/upload-artifact@v3
with:
name: win-coverage
path: htmlcov
if-no-files-found: error