diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..5f7a5725 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,5 @@ +[run] +branch = True +parallel = True +source = numalogic +omit = numalogic/tests/* diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 00000000..aca88d8c --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,24 @@ +name: Changelog + +on: + push: + tags: + - v* +jobs: + generate_changelog: + if: github.repository == 'numaproj/numalogic' + runs-on: ubuntu-latest + name: Generate changelog + steps: + - uses: actions/checkout@v2 + with: + ref: main + fetch-depth: 0 + - run: git fetch --prune --prune-tags + - run: git tag -l 'v*' + - run: ./hack/changelog.sh > CHANGELOG.md + - uses: peter-evans/create-pull-request@v3 + with: + title: 'docs: updated CHANGELOG.md' + commit-message: 'docs: updated CHANGELOG.md' + signoff: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b913bdfd..bcca9e43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Test +name: Build on: push: @@ -58,5 +55,10 @@ jobs: python-version: ${{ matrix.python-version }} cache: 'poetry' + - name: Install dependencies + run: | + poetry env use ${{ matrix.python-version }} + poetry install --no-root + - name: Black format check run: poetry run black --check . diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..7f062908 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,44 @@ +name: Coverage + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + name: Codecov + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9"] + + steps: + - uses: actions/checkout@v3 + + - name: Install poetry + run: pipx install poetry + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'poetry' + + - name: Install dependencies + run: | + poetry env use ${{ matrix.python-version }} + poetry install --no-root + + - name: Run Coverage + run: | + poetry run pytest --cov-report=xml --cov=numalogic --cov-config .coveragerc numalogic/tests/ -sq + + - name: Upload Coverage + uses: codecov/codecov-action@v3 + with: + files: ./coverage.xml + fail_ci_if_error: true + verbose: true diff --git a/README.md b/README.md index 7476d026..dbd320ab 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # numalogic +[![Build](https://github.com/numaproj/numalogic/actions/workflows/ci.yml/badge.svg)](https://github.com/numaproj/numalogic/actions/workflows/ci.yml) +[![Coverage](https://github.com/numaproj/numalogic/actions/workflows/coverage.yml/badge.svg?branch=main)](https://github.com/numaproj/numalogic/actions/workflows/coverage.yml) [![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) + Numa logic is a collection of operational ML models and tools.