From 695f6178f9f838d1a0f6ba9e728205ec2c768e46 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 19:00:56 +0000 Subject: [PATCH] feat: Setup GitHub CI and test coverage Added a GitHub Actions workflow to automate testing on push and pull requests. The workflow uses Poetry to install dependencies and runs pytest. Integrated test coverage reporting using pytest-cov and Codecov. Coverage reports are uploaded to Codecov on successful test runs. Added CI status and test coverage badges to README.md for quick visibility. --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..890d344 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.9 + uses: actions/setup-python@v3 + with: + python-version: 3.9 + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Install dependencies + run: poetry install + + - name: Run tests + run: poetry run pytest --cov=src/tensorweaver --cov-report=xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: ./coverage.xml # optional + flags: unittests # optional + name: codecov-umbrella # optional + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false) diff --git a/README.md b/README.md index 5069afc..fb3cc3e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # TensorWeaver +![CI](https://github.com/howl-anderson/tensorweaver/actions/workflows/ci.yml/badge.svg) +[![codecov](https://codecov.io/gh/howl-anderson/tensorweaver/branch/main/graph/badge.svg)](https://codecov.io/gh/howl-anderson/tensorweaver) +

TensorWeaver Logo