From d1bebd3412b5917b34cb701d61c81a25cfeca126 Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 6 Apr 2024 21:34:29 +0200 Subject: [PATCH] ci: merge coverage with regular CI tests --- .github/workflows/{test.yml => ci-tests.yml} | 11 ++++-- .github/workflows/coverage.yml | 39 -------------------- 2 files changed, 8 insertions(+), 42 deletions(-) rename .github/workflows/{test.yml => ci-tests.yml} (66%) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/test.yml b/.github/workflows/ci-tests.yml similarity index 66% rename from .github/workflows/test.yml rename to .github/workflows/ci-tests.yml index d42ebdf..3f98e2e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci-tests.yml @@ -24,6 +24,11 @@ jobs: python -m pip install --upgrade pip python -m pip install ".[test]" - - name: Test - run: | - python -m pytest + - name: Run pytest with coverage + run: python -m pytest --cov=lazy_loader --durations=10 + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: unittests,${{ runner.os }},py${{ matrix.python-version }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index ca30553..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: coverage - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - report: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install packages - run: | - python -m pip install --upgrade pip wheel setuptools - python -m pip install ".[test]" - python -m pip install --upgrade numpy - python -m pip uninstall --yes scipy - pip list - - - name: Measure test coverage - run: | - python -m pytest --cov=lazy_loader --durations=10 - # Tests fail if using `--doctest-modules`. I.e., - # python -m pytest --cov=lazy_loader --doctest-modules --durations=20 - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }}