From 50fb7831c4c97bf61adfb4927247d5a29f317a6a Mon Sep 17 00:00:00 2001 From: Verus20 Date: Sat, 17 Aug 2024 11:35:22 -0700 Subject: [PATCH] add coverage results for python --- .github/workflows/codecov_py.yaml | 32 +++++++++++++++++++ .../{codecov.yaml => codecov_ts.yaml} | 0 package.json | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/codecov_py.yaml rename .github/workflows/{codecov.yaml => codecov_ts.yaml} (100%) diff --git a/.github/workflows/codecov_py.yaml b/.github/workflows/codecov_py.yaml new file mode 100644 index 00000000..7dbf18c0 --- /dev/null +++ b/.github/workflows/codecov_py.yaml @@ -0,0 +1,32 @@ +# Workflow to codecov + +name: Run codecov +# Runs on push to any branch +on: + push: + pull_request: + branches: + - master + # Workflow can be triggered manually from the Actions tab + workflow_dispatch: + +jobs: + # Run tests + codecov: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + name: Checkout + - uses: actions/setup-python@v4 + name: Set up Python 3.10 + with: + python-version: '3.10' + - name: Install python dependencies + run: pip install -r controller/requirements.txt + - name: Run unit tests with code coverage + run: coverage run -m pytest + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + timeout-minutes: 1 diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov_ts.yaml similarity index 100% rename from .github/workflows/codecov.yaml rename to .github/workflows/codecov_ts.yaml diff --git a/package.json b/package.json index ae4f11d0..ee36ab53 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "scripts": { "test": "jest test", - "coverage": "jest --coverage", + "coverage": "jest --coverage --collectCoverageFrom='src/**/*.{ts,tsx}'", "ts-coverage": "typescript-coverage-report", "server": "npx ts-node src/server/server.ts" },