-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (39 loc) · 1.33 KB
/
Copy pathcoverage.yml
File metadata and controls
43 lines (39 loc) · 1.33 KB
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python Code Coverage
on:
push:
branches: [ "master" ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install package with test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]" --upgrade
python -m pip install coverage-badge
- name: Setup Git
run: |
git config --global user.name "Brent Barbachem"
git config --global user.email "barbacbd@dukes.jmu.edu"
- name: Execute the tests and push results
run: |
pytest --cov=nautical
mv .coverage .cov/
pushd .cov
rm coverage-badge.svg
coverage-badge -o coverage-badge.svg
popd
git ls-files --modified | xargs git add
git commit -m "[Automated Commit]: Adding code coverage information from unit tests." || echo "no changes to commit"
git push || echo "nothing to push"