-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.63 KB
/
run-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
name: Run Pytest
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version: [ "3.11" ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov pylint==2.17.5 python-dateutil==2.8.2 flask==2.3.2
- name: Checkout idss-engine-commons
uses: actions/checkout@v2
with:
repository: NOAA-GSL/idss-engine-commons
ref: main
path: commons/
- name: Install IDSSE python commons
working-directory: commons/python/idsse_common
run: pip install .
- name: Set PYTHONPATH for pytest
run: |
echo "PYTHONPATH=python/nwsc_dummy_service" >> $GITHUB_ENV
- name: Test pytest
working-directory: python/nwsc_dummy_service/test
run: |
set -o pipefail; # exit immediately if pytest fails (tee obfuscates the exit code)
pytest --cov=.. --cov-report=term --junitxml=./pytest.xml | tee ./coverage.txt;
- name: Pytest coverage comment
if: ${{ github.ref == 'refs/heads/main' }}
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
hide-comment: true
badge-title: Coverage
title: Report
pytest-coverage-path: python/nwsc_dummy_service/test/coverage.txt