-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (30 loc) · 908 Bytes
/
pytest.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
name: Python Tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Install pytest
run: |
pip install pytest pytest-cov
- name: Run tests
run: |
pytest --cov=gcms_data_analysis --cov-report=html
- name: Generate Badge
run: |
COVERAGE=$(cat docs/htmlcov/index.html | grep -oP '(?<=<td class="right">)[0-9]+\.[0-9]+%' | head -n 1 | tr -d '%')
curl "https://img.shields.io/badge/coverage-$COVERAGE-green.svg" > coverage.svg
- name: Upload Badge
uses: actions/upload-artifact@v2
with:
name: coverage-badge
path: coverage.svg