pyproject.toml install, created pytest suite, lint consolidation
#1
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| UV_CACHE_DIR: /tmp/.uv-cache | |
| PROJECT_PATH: "src/memory_profiler" | |
| jobs: | |
| code-quality: | |
| name: Check code quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| # https://github.com/actions/checkout | |
| - name: ⤵️ Checkout repository | |
| uses: actions/checkout@v4 | |
| # https://github.com/astral-sh/setup-uv | |
| - name: 🏗 Install uv and Python | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| cache-local-path: ${{ env.UV_CACHE_DIR }} | |
| python-version: "3.13" | |
| - name: 🏗 Install the project | |
| run: uv sync --locked --dev | |
| - name: Run mypy | |
| run: uv run --frozen mypy ${{ env.PROJECT_PATH }}/ | |
| - name: Pylint review | |
| run: uv run --frozen pylint ${{ env.PROJECT_PATH }}/ | |
| - name: Ruff check | |
| run: uv run --frozen ruff check ${{ env.PROJECT_PATH }}/ | |
| tests: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| steps: | |
| # https://github.com/actions/checkout | |
| - name: ⤵️ Checkout repository | |
| uses: actions/checkout@v4 | |
| # https://github.com/astral-sh/setup-uv | |
| - name: 🏗 Install uv and Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| cache-local-path: ${{ env.UV_CACHE_DIR }} | |
| python-version: ${{ matrix.python-version }} | |
| - name: 🏗 Install the project | |
| run: uv sync --locked --dev | |
| - name: Run pytest | |
| run: uv run --frozen pytest tests/ --cov=./ --cov-report=xml --junitxml=pytest-report.xml | |
| # https://github.com/actions/upload-artifact | |
| - name: Upload test report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pytest-report-${{ matrix.python-version }} | |
| path: pytest-report.xml | |
| # https://github.com/actions/upload-artifact | |
| - name: Upload coverage results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-results-${{ matrix.python-version }} | |
| path: coverage.xml | |
| # # https://github.com/codecov/codecov-action | |
| # - name: Upload coverage to Codecov | |
| # uses: codecov/codecov-action@v5 | |
| # with: | |
| # token: ${{ secrets.CODECOV_TOKEN }} | |
| # fail_ci_if_error: true |