Skip to content

[pre-commit.ci] pre-commit autoupdate #321

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #321

Workflow file for this run

---
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