Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[run]
source =
src
[report]
omit =
*/python?.?/*
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Gather coverage report and upload to codecov

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

defaults:
run:
shell: bash -l {0}

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Check out diffpy.snmf
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install diffpy.snmf and requirements
run: |
conda install --file requirements/run.txt
conda install --file requirements/test.txt
python -m pip install -r requirements/pip.txt
python -m pip install . --no-deps

- name: Validate diffpy.snmf
run: |
pytest --cov
coverage report -m
codecov

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,4 @@ jobs:
shell: bash -l {0}
run: |
conda activate test
coverage run -m pytest -vv -s
coverage report -m
codecov
pytest
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flake8
pytest
codecov
coverage
pytest-env
pytest-cov
Loading