Drop is_leaf property #32
This file contains hidden or 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: Tests | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| jobs: | |
| style: | |
| name: Check the code style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - uses: pre-commit/action@v3.0.0 | |
| tests: | |
| name: Run the tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| cache: 'pip' | |
| - name: Set up test environment | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . | |
| pip install pytest pytest-asyncio pytest-cov | |
| - name: Run tests | |
| run: | | |
| pytest --cov=dottxt | |
| - name: Check for coverage file | |
| run: ls -la | |
| - name: Upload coverage data | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-data | |
| path: .coverage | |
| if-no-files-found: error | |
| include-hidden-files: true | |
| coverage: | |
| name: Combine & check coverage. | |
| needs: tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| cache: 'pip' | |
| - name: Set up environment | |
| run: | | |
| pip install --upgrade "coverage[toml]>=5.1" diff-cover | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-data | |
| - name: Fetch main for coverage diff | |
| run: | | |
| git fetch --no-tags --prune origin main | |
| - name: Combine coverage & fail if it's <100%. | |
| run: | | |
| # Combine coverage files (not needed now, but maybe later) | |
| # python -m coverage combine | |
| # Produce an html report with absolute coverage information | |
| python -m coverage html --skip-covered --skip-empty | |
| # Report relative coverage and write to the workflow's summary | |
| python -m coverage xml | |
| diff-cover coverage.xml --markdown-report=coverage.md \ | |
| --fail-under=100 || \ | |
| (cat coverage.md >> $GITHUB_STEP_SUMMARY && exit 1) | |
| - name: Upload HTML report if check failed. | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: html-report | |
| path: htmlcov | |
| if: ${{ failure() }} |