Skip to content

added linter to CI

added linter to CI #15

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build and Test Package
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest]
steps:
# Step 1: Checkout the repository
- name: Checkout Code
uses: actions/checkout@v3
# Step 2: Set up Python environment
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Step 3: Cache Python dependencies
- name: Cache Python Dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-
# Step 4: Install dependencies
- name: Install Build Tools
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install pybind11
# Lint the code
- name: Lint Code
uses: wearerequired/[email protected]
with:
linters: |
pylint
# Step 5: Build the wheel
- name: Build Wheel
run: python setup.py bdist_wheel
# Step 6: Upload built wheels as artifacts
- name: Upload Built Wheels
uses: actions/upload-artifact@v3
with:
name: binaryparser-wheels
path: dist/*.whl
# Step 7: Install the built package
- name: Install Built Package
run: pip install dist/*.whl
# Step 8: Run tests
- name: Run Tests
env:
PYTHONPATH: ${{ github.workspace }}
run: |
pip install pytest
pytest tests/
# Optional Step: Debugging (if tests fail)
- name: Show Python Environment (Debug)
if: failure()
run: |
python --version
pip list
ls -R