Skip to content

Commit

Permalink
Merge pull request #32 from Ciela-Institute/codecov
Browse files Browse the repository at this point in the history
Add codecov coverage tests
  • Loading branch information
AlexaVillaume authored Nov 22, 2023
2 parents 334bc78 + 3d1093e commit 4359607
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Code Coverage

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Record State
run: |
pwd
echo github.ref is: ${{ github.ref }}
echo GITHUB_SHA is: $GITHUB_SHA
echo github.event_name is: ${{ github.event_name }}
echo github workspace: ${{ github.workspace }}
pip --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest-cov
pip install wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
shell: bash
- name: Install Light-House
run: |
cd $GITHUB_WORKSPACE/
pip install -e .
pip show lighthouse
shell: bash
- name: Load Light-House data
run: |
cd $GITHUB_WORKSPACE/.github/workflows/
python get_test_data.py
shell: bash
- name: Test with pytest
run: |
cd $GITHUB_WORKSPACE
pwd
pytest --cov-report=xml --cov=astrophot tests/
cat coverage.xml
shell: bash
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ${{ github.workspace }}/coverage.xml
fail_ci_if_error: true

0 comments on commit 4359607

Please sign in to comment.