Skip to content

Code coverage

Code coverage #1

Workflow file for this run

name: Workflow for Codecov
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout HEXRD
uses: actions/checkout@v4
with:
path: hexrd
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Checkout examples
uses: actions/checkout@v4
with:
repository: HEXRD/examples
path: examples
- name: Install HEXRD
run: |
pip install -e .
working-directory: hexrd
- name: Install requirements-dev.txt
run: |
pip install -r tests/requirements-dev.txt
working-directory: hexrd
- name: Run tests
env:
HEXRD_EXAMPLE_REPO_PATH: ${{ github.workspace }}/examples
run: |
pytest --cov hexrd --cov-report xml:coverage.xml tests
working-directory: hexrd
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
working-directory: hexrd