From 1e97e8166633537cdbc6081c6edd9f83b40a1c26 Mon Sep 17 00:00:00 2001 From: "Brett M. Morris" Date: Thu, 5 Feb 2026 12:51:18 -0500 Subject: [PATCH 1/2] add codecov --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c55549e..88a8938 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,4 +35,9 @@ jobs: - name: Code style checks python: 3.11 os: ubuntu-latest - linux: codestyle \ No newline at end of file + linux: codestyle + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 591e048c6494fab2c234ae7135aea19c43980bd7 Mon Sep 17 00:00:00 2001 From: "Brett M. Morris" Date: Thu, 5 Feb 2026 13:01:42 -0500 Subject: [PATCH 2/2] cruft fix --- .cruft.json | 2 +- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++-------- tox.ini | 8 ++++++-- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/.cruft.json b/.cruft.json index 59435dd..65485b0 100644 --- a/.cruft.json +++ b/.cruft.json @@ -9,7 +9,7 @@ "short_description": "Atomic and molecular opacities from MAESTRO", "author_name": "Brett Morris", "author_email": "morrisbrettm@gmail.com", - "project_url": "https://github.com/bmorris3/opacity", + "project_url": "https://github.com/opacities/opacity", "license": "Other", "minimum_python_version": "3.11", "use_compiled_extensions": "n", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88a8938..0426ed7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,21 +13,21 @@ concurrency: cancel-in-progress: true jobs: - test: + ci_tests: uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: envs: | - - name: tests, py3.11 + - name: py3.11 linux: test os: ubuntu-latest python-version: 3.11 - - name: tests, py3.12 + - name: py3.12 linux: test os: ubuntu-latest python-version: 3.12 - - name: tests, py3.13 + - name: py3.13 linux: test os: ubuntu-latest python-version: 3.13 @@ -37,7 +37,33 @@ jobs: os: ubuntu-latest linux: codestyle - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + - name: py3.12 with coverage + linux: test + os: ubuntu-latest + python: '3.12' + toxenv: py312-test-cov + toxposargs: --remote-data + + cov: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Install dependencies + run: + pip install pytest pytest-cov pytest-doctestplus pytest-remotedata . + + - name: Run tests + run: pytest --cov --cov-branch --cov-report=xml + + - name: Upload results to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/tox.ini b/tox.ini index bc0564c..009b3de 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] min_version = 4.0 envlist = - py{310,311,312}-test + py{310,311,312}-test{,-cov} py10-test-oldestdeps build_docs @@ -17,6 +17,7 @@ envlist = description = run tests oldestdeps: with the oldest supported version of key dependencies + cov: and test coverage # Pass through the following environment variables which may be needed for the CI pass_env = @@ -52,7 +53,10 @@ commands_pre = pip freeze commands = - pytest --pyargs opacity --cov opacity --cov-report xml:coverage.xml --cov-report term-missing {posargs} + pip freeze + !cov: pytest --pyargs opacity {toxinidir}/docs {posargs} --durations=30 + cov: pytest --pyargs opacity {toxinidir}/docs --cov opacity --cov-config={toxinidir}/pyproject.toml {posargs} --durations=30 + cov: coverage xml -o {toxinidir}/coverage.xml [testenv:build_docs] description = invoke sphinx-build to build the HTML docs