-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (42 loc) · 1.24 KB
/
pr.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
name: PR build
on:
push:
branches: [ 'dev' ]
pull_request:
branches: [ 'dev' ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
python -m pipenv install --dev
- name: Code Style
run: |
python -m pipenv run flake8 mdbackup
python -m pipenv run flake8 tests
- name: Test
run: |
python -m pipenv run coverage run --source=mdbackup --branch -m xmlrunner discover -s tests -p '*tests*.py' -o tests/.report
python -m pipenv run coverage html -d tests/.coverage-report/
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: tests/.report/**/*.xml
retention-days: 30
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: tests/.coverage-report/**/*.html
retention-days: 30