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 c55549e..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 @@ -35,4 +35,35 @@ jobs: - name: Code style checks python: 3.11 os: ubuntu-latest - linux: codestyle \ No newline at end of file + linux: codestyle + + - 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