9
9
pull_request :
10
10
branches : [ "main" ]
11
11
12
+ concurrency :
13
+ group : ${{ github.workflow }}-${{ github.ref }}
14
+
15
+ env :
16
+ FORCE_COLOR : 3
17
+ PROJECT_NAME : " diff_visualizer"
18
+
12
19
jobs :
13
20
build :
14
21
@@ -19,15 +26,15 @@ jobs:
19
26
python-version : ["3.9"]
20
27
21
28
steps :
22
- - uses : actions/checkout@v3
29
+ - uses : actions/checkout@v4
23
30
- name : Set up Python ${{ matrix.python-version }}
24
- uses : actions/setup-python@v3
31
+ uses : actions/setup-python@v5
25
32
with :
26
33
python-version : ${{ matrix.python-version }}
27
34
- name : Install dependencies
28
35
run : |
29
36
python -m pip install --upgrade pip
30
- python -m pip install flake8 pytest coverage
37
+ python -m pip install flake8 pytest pytest-cov coverage
31
38
pip install -r requirements.txt
32
39
33
40
- name : Clone diff_predictor and diff_classifier
@@ -56,28 +63,12 @@ jobs:
56
63
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
57
64
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
58
65
59
- - name : Run tests with coverage
66
+ - name : Run tests with pytest and pytest-cov
60
67
run : |
61
- coverage run -m pytest
62
- coverage report -m --fail-under=50 --skip-covered
63
-
64
- COVERAGE_PERCENT=$(coverage report -m --skip-covered | awk '/TOTAL/ { print $4 }' | sed 's/%$//' | awk '{ printf "%d\n", $1 }')
65
-
66
- echo "COVERAGE_PERCENT=${COVERAGE_PERCENT}" >> $GITHUB_ENV
67
-
68
-
69
- - name : Save coverage report
70
- uses : actions/upload-artifact@v2
71
- with :
72
- name : coverage-report
73
- path : coverage.xml
68
+ pytest -vvv -cov=${{ env.PROJECT_NAME }} --cov-report=xml --cov-report=term diff_viz/tests/
74
69
75
- - name : Upload coverage reports to Codecov
76
- uses : codecov/codecov-action@v4.0.1
77
- with :
78
- token : ${{ secrets.CODECOV_TOKEN }}
79
- slug : Nance-Lab/diff_diff_visualizer
70
+ - name : Upload coverage to Codecov
71
+ uses : codecov/codecov-action@v4
80
72
81
- # - name: Coveralls GitHub Action
82
- # uses: coverallsapp/github-action@v1
83
73
74
+
0 commit comments