-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (43 loc) · 1.1 KB
/
tests.yml
File metadata and controls
46 lines (43 loc) · 1.1 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
name: Run Tests
on:
pull_request:
branches: [ master ]
paths:
- 'examples/*'
- 'hackthebox/*'
- 'tests/*'
push:
branches: [ master ]
paths:
- 'examples/*'
- 'hackthebox/*'
- 'tests/*'
workflow_dispatch: {}
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip poetry
poetry install
- name: Run tests and generate coverage report
run: |
python3 -m pytest -n auto --cov=hackthebox --cov-report=xml
- name: Perform type checking
run: |
python3 -m mypy hackthebox
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
path_to_write_report: ./codecov_report.gz