Update CI workflow with robust configuration
Some checks failed
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / build (push) Has been cancelled
CI / lint (push) Has been cancelled

This commit is contained in:
2026-02-02 18:30:05 +00:00
parent f8e80b402e
commit 834983391c

View File

@@ -7,6 +7,20 @@ on:
branches: [ main, master ] branches: [ main, master ]
jobs: jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install flake8
run: pip install flake8
- name: Run flake8
run: flake8 src/ tests/ --max-line-length=100 --ignore=E501,W503
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
@@ -18,18 +32,13 @@ jobs:
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -e .[dev] pip install pytest click requests ghapi rich pyyaml diskcache
- name: Lint with flake8
run: |
pip install flake8
flake8 src/ tests/ --max-line-length=100 --ignore=E501,W503
- name: Run tests - name: Run tests
run: | run: pytest tests/ -v --tb=short
pip install pytest pytest-cov
pytest tests/ -v --tb=short
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -40,13 +49,14 @@ jobs:
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: '3.11' python-version: '3.11'
- name: Install dependencies cache: 'pip'
- name: Install build dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install build pip install build
python -m build - name: Build package
run: python -m build
- name: Verify build - name: Verify build
run: | run: |
pip install dist/*.whl pip install dist/*.whl
pip install requests ghapi
python -c "import code_pattern_search_cli; print('Build successful')" python -c "import code_pattern_search_cli; print('Build successful')"