fix: verify CI compliance - all tests pass locally
This commit is contained in:
@@ -2,18 +2,76 @@ name: CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main, master]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main, master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- run: pip install -e ".[dev]"
|
|
||||||
- run: pytest tests/ -v
|
- name: Cache pip packages
|
||||||
- run: ruff check .
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -e ".[dev]"
|
||||||
|
pip install pytest-cov
|
||||||
|
|
||||||
|
- name: Download spaCy model
|
||||||
|
run: python -m spacy download en_core_web_sm
|
||||||
|
|
||||||
|
- name: Lint with Ruff
|
||||||
|
run: pip install ruff && ruff check src/ tests/
|
||||||
|
|
||||||
|
- name: Check formatting with Black
|
||||||
|
run: pip install black && black --check src/ tests/
|
||||||
|
|
||||||
|
- name: Type check with MyPy
|
||||||
|
run: pip install mypy && mypy src/ --python-version 3.11
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: pytest tests/ -v --tb=short
|
||||||
|
|
||||||
|
- name: Run tests with coverage
|
||||||
|
run: pytest tests/ --cov=src/nl2gherkin --cov-report=term-missing --cov-report=xml
|
||||||
|
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
if: always()
|
||||||
|
uses: codecov/codecov-action@v4
|
||||||
|
with:
|
||||||
|
files: ./coverage.xml
|
||||||
|
fail_ci_if_error: false
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: pip install build
|
||||||
|
|
||||||
|
- name: Build package
|
||||||
|
run: python -m build
|
||||||
|
|
||||||
|
- name: Verify package
|
||||||
|
run: pip install dist/*.whl && nl2gherkin --help
|
||||||
|
|||||||
Reference in New Issue
Block a user