From a0e1623dd89728973116780ec3116f5491063c93 Mon Sep 17 00:00:00 2001 From: erexer <13180883+erexer@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:19:27 -0700 Subject: [PATCH 1/5] run tests on python 3.9-12, run tests every mon, rename to test.yml, upload to codecov --- .github/workflows/build.yml | 37 ----------------------- .github/workflows/test.yml | 60 +++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index fa0759d..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: build - -on: [push, pull_request] - -jobs: - build: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest] - - env: - OS: ${{ matrix.os }} - PYTHON: '3.9' - - steps: - - - uses: actions/checkout@v1 - - - name: Set up Python - uses: actions/setup-python@master - with: - python-version: 3.9 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install . - python -c 'import cerf; cerf.install_package_data()' - - - name: Test and generate coverage report on Linux - run: | - pip install pytest - pip install pytest-cov - pytest --cov=./ --cov-report=xml - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..8cf2fe5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,60 @@ +name: test + +on: + push: + branches: # on all branches except `typos` + - '**' + - '!typos' + paths-ignore: + - 'docs/**' + - 'notebooks/**' + - 'paper/**' + - '.git*' + - 'README.md' + pull_request: + branches: + - '**' + schedule: # Every Monday at 07:00 UTC, 00:00 PT + - cron: '0 7 * * 1' + +jobs: + build: + strategy: + matrix: + python-version: [ "3.9", "3.10", "3.11", "3.12" ] + os: [ubuntu-latest] + fail-fast: false + + name: Python ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@master + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install . + python -c 'import cerf; cerf.install_package_data()' + + - name: Test and generate coverage report + run: | + pip install pytest + pip install pytest-cov + pytest --cov=./ --cov-report=xml + + - uses: codecov/codecov-action@v4 + with: + files: ./coverage.xml # optional + name: codecov-umbrella # optional + token: ${{ secrets.CODECOV_TOKEN }} # required + + - name: Notify on failure + if: failure() # This step will only run if any previous step fails + run: | + echo "Build or tests failed. Please check the logs." From 1dd391c7e3f24462b081913cf1e8eec0f9cc41e0 Mon Sep 17 00:00:00 2001 From: erexer <13180883+erexer@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:30:05 -0700 Subject: [PATCH 2/5] run tests on python 3.9-12, run tests every mon, rename to test.yml, upload to codecov --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cf2fe5..5ca2588 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: build: strategy: matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] + python-version: [ "3.9", "3.10", "3.11" ] os: [ubuntu-latest] fail-fast: false From 598004db385b91c5c5d8a74123bb35927e4feaa7 Mon Sep 17 00:00:00 2001 From: erexer <13180883+erexer@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:41:44 -0700 Subject: [PATCH 3/5] add codecov to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e1384e9..890c088 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![build](https://github.com/IMMM-SFA/cerf/actions/workflows/build.yml/badge.svg)](https://github.com/IMMM-SFA/cerf/actions/workflows/build.yml) [![DOI](https://zenodo.org/badge/115649750.svg)](https://zenodo.org/badge/latestdoi/115649750) [![status](https://joss.theoj.org/papers/28fee3407bbbef020fb4bb19bd451407/status.svg)](https://joss.theoj.org/papers/28fee3407bbbef020fb4bb19bd451407) +[![codecov](https://codecov.io/gh/IMMM-SFA/cerf/graph/badge.svg?token=9jbGJv8XCJ)](https://codecov.io/gh/IMMM-SFA/cerf) ## cerf From fe7521029383d849a3964db3793df84db74caa4a Mon Sep 17 00:00:00 2001 From: erexer <13180883+erexer@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:25:19 -0700 Subject: [PATCH 4/5] add python version badge, pypi badge --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 890c088..9c5592e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -[![build](https://github.com/IMMM-SFA/cerf/actions/workflows/build.yml/badge.svg)](https://github.com/IMMM-SFA/cerf/actions/workflows/build.yml) +[![PyPI version](https://badge.fury.io/py/cerf.svg)](https://badge.fury.io/py/cerf) +![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cerf?pypiBaseUrl=https%3A%2F%2Fpypi.org&logo=python&logoColor=yellow) +[![test](https://github.com/IMMM-SFA/cerf/actions/workflows/test.yml/badge.svg)](https://github.com/IMMM-SFA/cerf/actions/workflows/test.yml) [![DOI](https://zenodo.org/badge/115649750.svg)](https://zenodo.org/badge/latestdoi/115649750) [![status](https://joss.theoj.org/papers/28fee3407bbbef020fb4bb19bd451407/status.svg)](https://joss.theoj.org/papers/28fee3407bbbef020fb4bb19bd451407) [![codecov](https://codecov.io/gh/IMMM-SFA/cerf/graph/badge.svg?token=9jbGJv8XCJ)](https://codecov.io/gh/IMMM-SFA/cerf) From e0b95a9ad56bc6a02e9e65b77273d3a1834e0f66 Mon Sep 17 00:00:00 2001 From: erexer <13180883+erexer@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:44:40 -0700 Subject: [PATCH 5/5] fix python versions link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c5592e..78792d9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![PyPI version](https://badge.fury.io/py/cerf.svg)](https://badge.fury.io/py/cerf) -![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cerf?pypiBaseUrl=https%3A%2F%2Fpypi.org&logo=python&logoColor=yellow) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cerf?pypiBaseUrl=https%3A%2F%2Fpypi.org&logo=python&logoColor=yellow)](https://pypi.org/project/cerf/) [![test](https://github.com/IMMM-SFA/cerf/actions/workflows/test.yml/badge.svg)](https://github.com/IMMM-SFA/cerf/actions/workflows/test.yml) [![DOI](https://zenodo.org/badge/115649750.svg)](https://zenodo.org/badge/latestdoi/115649750) [![status](https://joss.theoj.org/papers/28fee3407bbbef020fb4bb19bd451407/status.svg)](https://joss.theoj.org/papers/28fee3407bbbef020fb4bb19bd451407)