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
87 changes: 70 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,34 @@ jobs:
poetry run mypy .

- name: Tests with Pytest
id: pytest
continue-on-error: true
run: |
source venv/Scripts/activate
PYTHONPATH=${PWD} poetry run coverage run -m pytest --verbose

- name: Report coverage
run: |
source venv/Scripts/activate
poetry run coverage report
PYTHONPATH=${PWD} poetry run pytest \
-n auto \
--dist loadscope \
--cov=openseries \
--cov-report=term \
--cov-report=term-missing \
--cov-report=xml \
--junitxml=junit.xml

- name: Create GitHub issue on failure
if: ${{ steps.pytest.outcome == 'failure' }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
await github.rest.issues.create({
owner: 'CaptorAB',
repo: 'openseries',
title: `Tests failed on ${new Date().toDateString()}`,
body: `See the full logs here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`,
})

- name: Fail job if tests failed
if: ${{ steps.pytest.outcome == 'failure' }}
run: exit 1

- name: Package and check
run: |
Expand Down Expand Up @@ -154,14 +174,34 @@ jobs:
poetry run mypy .

- name: Tests with Pytest
id: pytest
continue-on-error: true
run: |
source venv/bin/activate
PYTHONPATH=${PWD} poetry run coverage run -m pytest --verbose

- name: Report coverage
run: |
source venv/bin/activate
poetry run coverage report
PYTHONPATH=${PWD} poetry run pytest \
-n auto \
--dist loadscope \
--cov=openseries \
--cov-report=term \
--cov-report=term-missing \
--cov-report=xml \
--junitxml=junit.xml

- name: Create GitHub issue on failure
if: ${{ steps.pytest.outcome == 'failure' }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
await github.rest.issues.create({
owner: 'CaptorAB',
repo: 'openseries',
title: `Tests failed on ${new Date().toDateString()}`,
body: `See the full logs here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`,
})

- name: Fail job if tests failed
if: ${{ steps.pytest.outcome == 'failure' }}
run: exit 1

- name: Package and check
run: |
Expand Down Expand Up @@ -232,14 +272,27 @@ jobs:
poetry run mypy .

- name: Tests with Pytest
id: pytest
continue-on-error: true
run: |
source venv/bin/activate
PYTHONPATH=${PWD} poetry run coverage run -m pytest --verbose
PYTHONPATH=${PWD} poetry run pytest --cov=openseries --dist loadscope -n auto

- name: Report coverage
run: |
source venv/bin/activate
poetry run coverage report
- name: Create GitHub issue on failure
if: ${{ steps.pytest.outcome == 'failure' }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
await github.rest.issues.create({
owner: 'CaptorAB',
repo: 'openseries',
title: `Tests failed on ${new Date().toDateString()}`,
body: `See the full logs here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`,
})

- name: Fail job if tests failed
if: ${{ steps.pytest.outcome == 'failure' }}
run: exit 1

- name: Package and check
run: |
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,18 @@ jobs:
poetry run mypy .

- name: Tests with Pytest
id: pytest
continue-on-error: true
run: |
source venv/bin/activate
PYTHONPATH=${PWD} poetry run coverage run -m pytest --verbose
PYTHONPATH=${PWD} poetry run pytest \
-n auto \
--dist loadscope \
--cov=openseries \
--cov-report=term \
--cov-report=term-missing \
--cov-report=xml \
--junitxml=junit.xml

- name: Create GitHub issue on failure
if: ${{ steps.pytest.outcome == 'failure' }}
Expand All @@ -81,19 +90,20 @@ jobs:
if: ${{ steps.pytest.outcome == 'failure' }}
run: exit 1

- name: Report coverage
run: |
source venv/bin/activate
poetry run coverage xml --quiet
poetry run coverage report
- name: Upload test results to Codecov
if: ${{ github.ref_name == 'master' }}
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: junit.xml
verbose: true

- name: Upload coverage to Codecov.io
if: ${{ github.ref_name == 'master' }}
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: CaptorAB/openseries
fail_ci_if_error: true
files: ./coverage.xml
verbose: true

- name: Create Git Tag with version from pyproject.toml
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ jobs:
continue-on-error: true
run: |
source venv/bin/activate
PYTHONPATH=${PWD} poetry run coverage run -m pytest --verbose
PYTHONPATH=${PWD} poetry run pytest \
-n auto \
--dist loadscope \
--cov=openseries \
--cov-report=term \
--cov-report=term-missing \
--cov-report=xml \
--junitxml=junit.xml

- name: Create GitHub issue on failure
if: ${{ steps.pytest.outcome == 'failure' }}
Expand All @@ -108,17 +115,18 @@ jobs:
if: ${{ steps.pytest.outcome == 'failure' }}
run: exit 1

- name: Report coverage
run: |
source venv/bin/activate
poetry run coverage xml --quiet
poetry run coverage report
- name: Upload test results to Codecov
if: ${{ github.ref_name == 'master' }}
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: junit.xml
verbose: true

- name: Upload coverage to Codecov.io
if: ${{ github.ref_name == 'master' }}
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: CaptorAB/openseries
fail_ci_if_error: true
files: ./coverage.xml
verbose: true
1 change: 1 addition & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ rules:
- softprops/action-gh-release
- astral-sh/setup-uv
- codecov/codecov-action
- codecov/test-results-action
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ __pycache__/

# Coverage files
.coverage
coverage.xml

# Environments
/venv/
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ install:
poetry run pre-commit install

test:
poetry run coverage run -m pytest --verbose
poetry run coverage xml --quiet
poetry run coverage report
poetry run pytest --cov=openseries --cov-report=term --cov-report=term-missing -n auto

lint:
poetry run ruff check . --fix --exit-non-zero-on-fix
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
![Platform](https://img.shields.io/badge/platforms-Windows%20%7C%20macOS%20%7C%20Linux-blue)
[![Python version](https://img.shields.io/pypi/pyversions/openseries.svg)](https://www.python.org/)
[![GitHub Action Test Suite](https://github.com/CaptorAB/openseries/actions/workflows/test.yml/badge.svg)](https://github.com/CaptorAB/openseries/actions/workflows/test.yml)
[![codecov](https://img.shields.io/codecov/c/gh/CaptorAB/openseries)](https://codecov.io/gh/CaptorAB/openseries/branch/master)
[![codecov](https://img.shields.io/codecov/c/gh/CaptorAB/openseries?logo=codecov)](https://codecov.io/gh/CaptorAB/openseries/branch/master)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://beta.ruff.rs/docs/)
[![GitHub License](https://img.shields.io/github/license/CaptorAB/openseries)](https://github.com/CaptorAB/openseries/blob/master/LICENSE.md)
Expand Down Expand Up @@ -54,7 +54,7 @@ _,_=series.plot_series()

### Sample output using the report_html() function:

<img src="./captor_plot_image.png" alt="Two Assets Compared" width="1000" />
<img src="https://raw.githubusercontent.com/CaptorAB/openseries/master/captor_plot_image.png" alt="Two Assets Compared" width="1000" />

## Development Instructions

Expand Down
Loading