fix: crashed when Post.content
is None and post dir did not create
#19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Coverage | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- "ktoolbox/**" | |
- "tests/**" | |
- ".github/actions/setup-python/**" | |
- ".github/workflows/codecov.yml" | |
- "pyproject.toml" | |
- "prod.env" | |
pull_request: | |
paths: | |
- "ktoolbox/**" | |
- "tests/**" | |
- ".github/actions/setup-python/**" | |
- ".github/workflows/codecov.yml" | |
- "pyproject.toml" | |
- "prod.env" | |
jobs: | |
test: | |
name: Test Coverage | |
runs-on: ${{ matrix.os }} | |
concurrency: | |
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }} | |
cancel-in-progress: true | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
fail-fast: false | |
env: | |
PYTEST_REPORT_FILENAME: report-${{ matrix.os }}-${{ matrix.python-version }}.html | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python environment | |
uses: ./.github/actions/setup-python | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run Pytest | |
run: | | |
cd tests/ | |
poetry run pytest -v --capture=sys --cov --cov-report=xml --html=${{ env.PYTEST_REPORT_FILENAME }} --self-contained-html | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: ./tests/coverage.xml | |
flags: unit | |
- name: Upload pytest HTML result | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.PYTEST_REPORT_FILENAME }} | |
path: ./tests/${{ env.PYTEST_REPORT_FILENAME }} |