Add 'meta' markdown extension to configuration #349
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: Run Tests and Upload Coverage | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| # Pre-commit runs once (not for each Python version) | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| cache-dependency-glob: uv.lock | |
| - name: Sync dependencies | |
| run: uv sync --locked --extra cpu --dev | |
| - name: Cache pre-commit | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pre-commit/ | |
| key: pre-commit-3.12-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Run pre-commit checks | |
| run: uv run pre-commit run --all-files | |
| env: | |
| SKIP: no-commit-to-branch | |
| # Tests run in parallel across Python versions | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| cache-dependency-glob: uv.lock | |
| - name: Sync dependencies | |
| run: uv sync --locked --extra cpu --dev | |
| - name: Run tests with coverage | |
| run: uv run pytest --cov=city2graph --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.xml | |
| fail_ci_if_error: true |