From d82d59f6ab80f90a289b1ab085b9ee31acd11308 Mon Sep 17 00:00:00 2001 From: Kevin Lewis <55998034+kevindlewis23@users.noreply.github.com> Date: Tue, 2 Jul 2024 13:19:16 -0400 Subject: [PATCH] Code coverage (#656) * Change badge to point to hexrd * Point status badge to hexrd * move codecov to test yaml * Remove unused token from readme --- .github/workflows/test.yml | 21 ++++++++++++++++++++- README.md | 3 ++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea3cd94ca..62e37eed5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,8 +61,9 @@ jobs: if: ${{ matrix.config.os == 'macos-latest'}} - name: Install HEXRD + # Install in editable mode for codecov run: | - pip install . + pip install -e . working-directory: hexrd - name: Install requirements-dev.txt @@ -75,4 +76,22 @@ jobs: HEXRD_EXAMPLE_REPO_PATH: ${{ github.workspace }}/examples run: | pytest -s tests/ + if: ${{ matrix.config.os != 'ubuntu-latest'}} working-directory: hexrd + + - name: Run tests with codecov + env: + HEXRD_EXAMPLE_REPO_PATH: ${{ github.workspace }}/examples + run: | + pytest -s --cov hexrd --cov-report xml:coverage.xml tests/ + if: ${{ matrix.config.os == 'ubuntu-latest'}} + working-directory: hexrd + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.xml + working-directory: hexrd + if: ${{ matrix.config.os == 'ubuntu-latest'}} + diff --git a/README.md b/README.md index 07028c515..e80a2b46b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8033939.svg)](https://doi.org/10.5281/zenodo.8033939) ![conda-package](https://github.com/HEXRD/hexrd/workflows/conda-package/badge.svg) ![test](https://github.com/HEXRD/hexrd/workflows/test/badge.svg) ![latest version](https://anaconda.org/hexrd/hexrd/badges/version.svg) ![last updated](https://anaconda.org/hexrd/hexrd/badges/latest_release_relative_date.svg) ![downloads](https://anaconda.org/hexrd/hexrd/badges/downloads.svg) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8033939.svg)](https://doi.org/10.5281/zenodo.8033939) ![conda-package](https://github.com/HEXRD/hexrd/workflows/conda-package/badge.svg) ![test](https://github.com/HEXRD/hexrd/workflows/test/badge.svg) [![codecov](https://codecov.io/gh/Hexrd/hexrd/graph/badge.svg)](https://codecov.io/gh/Hexrd/hexrd) ![latest version](https://anaconda.org/hexrd/hexrd/badges/version.svg) ![last updated](https://anaconda.org/hexrd/hexrd/badges/latest_release_relative_date.svg) ![downloads](https://anaconda.org/hexrd/hexrd/badges/downloads.svg) + # HEXRD The HEXRD project is developing a cross-platform, open-source library for the general analysis of X-ray diffraction data. This includes powder diffraction, Laue diffraction, and High Energy Diffraction Microscopy (_a.k.a._ 3DXRD, multi-grain rotation method) modalities. At its core, HEXRD provides an abstraction of a generic diffraction instrument with support for multiple detectors. This includes optimized transforms from the direct and reciprocal crystal lattices to the local detector coordinates, harnesses for interpolating image data into scattering angle coordinates, and sophisticated calibration routines.