diff --git a/.github/workflows/push.yml b/.github/workflows/build-pipeline.yml similarity index 99% rename from .github/workflows/push.yml rename to .github/workflows/build-pipeline.yml index fdc385e..19d781c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/build-pipeline.yml @@ -20,6 +20,8 @@ env: jobs: run_tests: uses: ./.github/workflows/run_tests.yml + secrets: + codecov_token: ${{ secrets.CODECOV_TOKEN }} bump_version: needs: run_tests diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3bb60c9..3b6ca11 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,8 +6,13 @@ name: Receive PR on: pull_request: # Sequence of patterns matched against refs/heads - branches: [ feature/**, issue/**, issues/** ] + branches: + - feature/** + - issue/** + - issues/** jobs: build_and_test: uses: ./.github/workflows/run_tests.yml + secrets: + codecov_token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index b2d0e7b..8099ce4 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -7,28 +7,32 @@ name: A reusable workflow to build and run the unit test suite on: workflow_call: + secrets: + codecov_token: + required: true workflow_dispatch: +env: + POETRY_VERSION: "1.3.2" + PYTHON_VERSION: "3.10" + jobs: build_and_test: runs-on: ubuntu-latest - strategy: - matrix: - python-version: [ '3.10' ] - name: Python ${{ matrix.python-version }} tests steps: - - uses: actions/checkout@v4 + - name: Retrieve repository + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ env.PYTHON_VERSION }} - name: Set up Poetry uses: abatilo/actions-poetry@v3.0.0 with: - poetry-version: 1.3.2 + poetry-version: ${{ env.POETRY_VERSION }} - name: Install package run: poetry install @@ -41,16 +45,8 @@ jobs: run: | poetry run pytest --cov=batcher --cov-report=xml:build/reports/coverage.xml --cov-report=html:build/reports/coverage.html tests/ - - name: Archive code coverage report (xml) - if: ${{ always() }} - uses: actions/upload-artifact@v4 - with: - name: code coverage report (xml) - path: build/reports/coverage.xml - - - name: Archive code coverage report (HTML) - if: ${{ always() }} - uses: actions/upload-artifact@v4 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 with: - name: code coverage report (HTML) - path: build/reports/coverage.html + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b0f78ff..ca6cc14 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,14 +15,14 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.3.5' + rev: 'v0.4.1' hooks: - id: ruff args: [ "--fix" ] # https://github.com/python/black#version-control-integration - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.0 hooks: - id: black-jupyter diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dc6385..46a255b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [PR #75](https://github.com/danielfromearth/batchee/pull/75): Add Docker build steps to GitHub Actions workflow - [PR #84](https://github.com/danielfromearth/batchee/pull/84): Add readme badges - [PR #100](https://github.com/danielfromearth/batchee/pull/100): Add license +- [PR #111](https://github.com/nasa/batchee/pull/111): Add codecov to CI pipeline ### Changed - [issue/11](https://github.com/danielfromearth/batchee/issues/11): Rename from concat_batcher to batchee - [issue/21](https://github.com/danielfromearth/batchee/issues/21): Improve CICD workflows diff --git a/poetry.lock b/poetry.lock index e8aea5d..25001ee 100644 --- a/poetry.lock +++ b/poetry.lock @@ -48,17 +48,17 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "boto3" -version = "1.34.79" +version = "1.34.88" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.34.79-py3-none-any.whl", hash = "sha256:265b0b4865e8c07e27abb32a31d2bd9129bb009b1d89ca0783776ec084886123"}, - {file = "boto3-1.34.79.tar.gz", hash = "sha256:139dd2d94eaa0e3213ff37ba7cf4cb2e3823269178fe8f3e33c965f680a9ddde"}, + {file = "boto3-1.34.88-py3-none-any.whl", hash = "sha256:1bd4cef11b7c5f293cede50f3d33ca89fe3413c51f1864f40163c56a732dd6b3"}, + {file = "boto3-1.34.88.tar.gz", hash = "sha256:168894499578a9d69d6f7deb5811952bf4171c51b95749a9aef32cf67bc71f87"}, ] [package.dependencies] -botocore = ">=1.34.79,<1.35.0" +botocore = ">=1.34.88,<1.35.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -67,13 +67,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.79" +version = "1.34.88" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.34.79-py3-none-any.whl", hash = "sha256:a42a014d3dbaa9ef123810592af69f9e55b456c5be3ac9efc037325685519e83"}, - {file = "botocore-1.34.79.tar.gz", hash = "sha256:6b59b0f7de219d383a2a633f6718c2600642ebcb707749dc6c67a6a436474b7a"}, + {file = "botocore-1.34.88-py3-none-any.whl", hash = "sha256:e87a660599ed3e14b2a770f4efc3df2f2f6d04f3c7bfd64ddbae186667864a7b"}, + {file = "botocore-1.34.88.tar.gz", hash = "sha256:36f2e9e8dfa856e55dbbe703aea601f134db3fddc3615f1020a755b27fd26a5e"}, ] [package.dependencies] @@ -82,7 +82,7 @@ python-dateutil = ">=2.1,<3.0.0" urllib3 = {version = ">=1.25.4,<2.2.0 || >2.2.0,<3", markers = "python_version >= \"3.10\""} [package.extras] -crt = ["awscrt (==0.19.19)"] +crt = ["awscrt (==0.20.9)"] [[package]] name = "certifi" @@ -366,13 +366,13 @@ packaging = "*" [[package]] name = "exceptiongroup" -version = "1.2.0" +version = "1.2.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, - {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, + {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, + {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, ] [package.extras] @@ -528,13 +528,13 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest- [[package]] name = "pluggy" -version = "1.4.0" +version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" files = [ - {file = "pluggy-1.4.0-py3-none-any.whl", hash = "sha256:7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981"}, - {file = "pluggy-1.4.0.tar.gz", hash = "sha256:8c85c2876142a764e5b7548e7d9a0e0ddb46f5185161049a79b7e974454223be"}, + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, ] [package.extras] diff --git a/pyproject.toml b/pyproject.toml index 530d4e0..a6c1b3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,8 @@ exclude = [ "_typed_ops.pyi", ] target-version = "py310" + +[tool.ruff.lint] # E402: module level import not at top of file # E501: line too long - let black worry about that # E731: do not assign a lambda expression, use a def