-
Notifications
You must be signed in to change notification settings - Fork 6
96 lines (83 loc) · 2.98 KB
/
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge
activate-environment: lume-services-dev
environment-file: dev-environment.yml
#- name: flake8
# shell: bash -l {0}
# run: |
# flake8 .
- name: Install lume-services
shell: bash -l {0}
run: |
pip install -e .
- run: mkdir coverage
- name: Run Tests
shell: bash -l {0}
run: |
pytest --cov-report term --cov=lume_services --junitxml=./coverage/pytest.xml | tee ./coverage/pytest-coverage.txt
- name: store coverage files
if: always()
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
coverage:
if: always()
runs-on: ubuntu-latest
needs: test
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: get coverage files
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
- name: Pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./coverage/pytest-coverage.txt
junitxml-path: ./coverage/pytest.xml
- name: Check the output coverage
run: |
echo "Coverage Percantage - ${{ steps.coverageComment.outputs.coverage }}"
echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}"
echo "Coverage Html - ${{ steps.coverageComment.outputs.coverageHtml }}"
echo "Coverage Warnings - ${{ steps.coverageComment.outputs.warnings }}"
echo "Coverage Errors - ${{ steps.coverageComment.outputs.errors }}"
echo "Coverage Failures - ${{ steps.coverageComment.outputs.failures }}"
echo "Coverage Skipped - ${{ steps.coverageComment.outputs.skipped }}"
echo "Coverage Tests - ${{ steps.coverageComment.outputs.tests }}"
echo "Coverage Time - ${{ steps.coverageComment.outputs.time }}"
echo "Not Success Test Info - ${{ steps.coverageComment.outputs.notSuccessTestInfo }}"
- name: Create the Badge
if: ${{ github.repository == 'slaclab/lume-services' }}
uses: schneegans/dynamic-badges-action@v1.4.0
with:
auth: ${{ secrets.PYTEST_COVERAGE_COMMENT }}
gistID: 61dce43449fc0509f34520fd7efc41b1
filename: slaclab-lume-services-coverage.json
label: Coverage Report
message: ${{ steps.coverageComment.outputs.coverage }}
color: ${{ steps.coverageComment.outputs.color }}
namedLogo: python