mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add coverage test
This commit is contained in:
parent
8c7c29e4f2
commit
c209eef0cd
1 changed files with 37 additions and 2 deletions
39
.github/workflows/main.yml
vendored
39
.github/workflows/main.yml
vendored
|
|
@ -39,14 +39,23 @@ jobs:
|
|||
pandoc-version: "2.9.2"
|
||||
- name: Install tox
|
||||
run: python -m pip install -U pip tox
|
||||
- name: Install invoke
|
||||
run: python -m pip install invoke
|
||||
- name: Info
|
||||
run: |
|
||||
echo "===== PYTHON ====="
|
||||
python --version
|
||||
echo "===== PANDOC ====="
|
||||
pandoc --version | head -2
|
||||
- name: Run tests
|
||||
run: tox -e py${{ matrix.python }}
|
||||
- name: Run tests with coverage
|
||||
run: invoke coverage
|
||||
|
||||
- name: Upload coverage data
|
||||
uses: "actions/upload-artifact@v4"
|
||||
with:
|
||||
name: coverage-data
|
||||
path: ".coverage.*"
|
||||
if-no-files-found: error
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
|
|
@ -66,6 +75,32 @@ jobs:
|
|||
- name: Run pre-commit checks on all files
|
||||
uses: pre-commit/action@v3.0.1
|
||||
|
||||
coverage:
|
||||
runs-on: "ubuntu-latest"
|
||||
needs: test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
cache: "pip"
|
||||
cache-dependency-path: "**/requirements/*"
|
||||
|
||||
- name: "Install Coverage.py"
|
||||
run: "python -m pip install --upgrade coverage[toml]"
|
||||
|
||||
- name: "Download coverage data"
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: coverage-data
|
||||
|
||||
- name: "Combine & check coverage"
|
||||
run: |
|
||||
set -xe
|
||||
python -m coverage combine
|
||||
python -m coverage report --fail-under=74
|
||||
|
||||
build:
|
||||
name: Test build
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue