From 047901d02707a8cf16f6645830d321b4ccab5d64 Mon Sep 17 00:00:00 2001 From: Matt Jaquiery Date: Tue, 12 Nov 2024 00:09:58 +0000 Subject: [PATCH] feat: add GitHub CI - CI tests - CodeCov for coverage - README badges --- .github/workflows/test.yml | 32 ++++++++++++++++++++++++++++++++ README.md | 3 +++ requirements.txt | 1 + 3 files changed, 36 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e0d2cc8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +on: push +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ "3.11", "3.12", "3.13" ] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - uses: actions/checkout@v4 + - name: Install dependencies + run: pip install -r requirements.txt + - name: Install CodeCov dependencies + run: pip install pytest pytest-cov + - name: Install self + run: pip install -e . + - name: Run tests + run: | + cd tests + pytest --cov --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./tests/coverage.xml + flags: unittests + fail_ci_if_error: false diff --git a/README.md b/README.md index 6ce2fab..21be1a6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Treatment Resistant Depression Database Command Line Interface +[![.github/workflows/test.yml](https://github.com/OxfordRSE/trd-cli/actions/workflows/test.yml/badge.svg)](https://github.com/OxfordRSE/trd-cli/actions/workflows/test.yml) +[![codecov](https://codecov.io/github/OxfordRSE/trd-cli/graph/badge.svg?token=myj04HCbDQ)](https://codecov.io/github/OxfordRSE/trd-cli) + This CLI performs automated data collection and curation for the TRD Database project. ## Deployment diff --git a/requirements.txt b/requirements.txt index 2b7c0f5..2a1607e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ click==8.1.7 pycap==2.6.0 requests==2.32.3 +typing_extensions==4.12.2 \ No newline at end of file