From e186bbfe9a3e77ca6f9234a3e708ec915a6f7537 Mon Sep 17 00:00:00 2001 From: Martin Staadecker Date: Wed, 27 Mar 2024 18:26:05 -0400 Subject: [PATCH] Add github workflow with code coverage --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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..d2f2ed0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: Workflow for Codecov +on: [pull_request] +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install dependencies + run: pip install . + - name: Run ATS + uses: codecov/codecov-ats@v0 + env: + CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Run tests and collect coverage + run: pytest --cov app ${{ env.CODECOV_ATS_TESTS }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4-beta + with: + flags: smart-tests + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file