[pre-commit.ci] pre-commit autoupdate #321
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] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - name: π₯ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: π¦ Install Poetry | |
| run: | | |
| curl -sSL https://install.python-poetry.org | python3 - | |
| echo "${HOME}/.local/bin" >> $GITHUB_PATH | |
| - name: π Install dependencies | |
| run: | | |
| poetry config virtualenvs.create false | |
| poetry install --no-interaction --no-ansi | |
| - name: π’ Set up Node (dashboard checks) | |
| if: matrix.python-version == '3.12' | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| cache-dependency-path: dashboard/package-lock.json | |
| - name: π¦ Install dashboard dependencies | |
| if: matrix.python-version == '3.12' | |
| run: npm --prefix dashboard ci | |
| - name: π§ͺ Dashboard tests | |
| if: matrix.python-version == '3.12' | |
| run: npm --prefix dashboard test | |
| - name: π§Ό Dashboard lint | |
| if: matrix.python-version == '3.12' | |
| run: npm --prefix dashboard run lint | |
| - name: ποΈ Dashboard build | |
| if: matrix.python-version == '3.12' | |
| run: npm --prefix dashboard run build | |
| - name: π¦ CLI smoke dry-run (safe subset) | |
| run: | | |
| poetry run nlx --help | |
| poetry run nlx --dry-run --no-reports --task Mise --task Security | |
| - name: π§Ό Lint with Ruff | |
| run: poetry run ruff check . | |
| - name: π§½ Format check with Black | |
| run: poetry run black --check . | |
| - name: π Sort imports with isort | |
| run: poetry run isort --check-only . | |
| - name: π Static type check with Mypy | |
| run: poetry run mypy . | |
| - name: π§ͺ Run tests with coverage | |
| run: | | |
| poetry run pytest -q --maxfail=1 --disable-warnings \ | |
| --cov=nextlevelapex --cov-branch \ | |
| --cov-report=xml:coverage.xml \ | |
| --cov-report=term \ | |
| --cov-report=html:htmlcov | |
| - name: Upload coverage reports to Codecov | |
| if: always() && matrix.python-version == '3.12' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage.xml # be explicit | |
| flags: py${{ matrix.python-version }} | |
| # Omit token for public repos; add it if private: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: Doogie201/NextLevelApex | |
| fail_ci_if_error: true | |
| verbose: true | |
| - name: π§Ύ Verify htmlcov/ directory and contents | |
| if: always() | |
| run: | | |
| echo "π΅οΈ Checking for htmlcov/..." | |
| if [ -d "htmlcov" ]; then | |
| echo "β htmlcov/ directory FOUND. Listing contents:" | |
| ls -lAR htmlcov/ | |
| else | |
| echo "β htmlcov/ directory NOT FOUND in $(pwd)." | |
| exit 1 | |
| fi | |
| - name: π€ Upload coverage report | |
| if: github.event_name == 'push' && matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: coverage-report | |
| path: htmlcov/ | |
| if-no-files-found: error | |
| retention-days: 7 | |
| overwrite: true | |
| - name: π¨ Enforce minimum coverage threshold | |
| # Baseline floor to prevent regressions while coverage is improved incrementally. | |
| run: poetry run coverage report --rcfile=.coveragerc --fail-under=40 |