Update CI workflow with robust configuration
This commit is contained in:
@@ -7,6 +7,20 @@ on:
|
||||
branches: [ main, master ]
|
||||
|
||||
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:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
@@ -18,18 +32,13 @@ jobs:
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e .[dev]
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
pip install flake8
|
||||
flake8 src/ tests/ --max-line-length=100 --ignore=E501,W503
|
||||
pip install pytest click requests ghapi rich pyyaml diskcache
|
||||
- name: Run tests
|
||||
run: |
|
||||
pip install pytest pytest-cov
|
||||
pytest tests/ -v --tb=short
|
||||
run: pytest tests/ -v --tb=short
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -40,13 +49,14 @@ jobs:
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Install dependencies
|
||||
cache: 'pip'
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
python -m build
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
- name: Verify build
|
||||
run: |
|
||||
pip install dist/*.whl
|
||||
pip install requests ghapi
|
||||
python -c "import code_pattern_search_cli; print('Build successful')"
|
||||
|
||||
Reference in New Issue
Block a user