|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, develop ] |
| 6 | + pull_request: |
| 7 | + branches: [ main, develop ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 15 | + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v5 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + python -m pip install --upgrade pip |
| 28 | + pip install -r requirements.txt |
| 29 | + |
| 30 | + - name: Lint with flake8 |
| 31 | + run: | |
| 32 | + pip install flake8 |
| 33 | + # Stop the build if there are Python syntax errors or undefined names |
| 34 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 35 | + # Exit-zero treats all errors as warnings |
| 36 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 37 | + |
| 38 | + - name: Test import |
| 39 | + run: | |
| 40 | + python -c "from ai_commit import OllamaClient, GitService, CommitGenerator" |
| 41 | + |
| 42 | + - name: Check script execution |
| 43 | + run: | |
| 44 | + python ai_commit.py --help || true |
| 45 | +
|
| 46 | + lint: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Set up Python |
| 53 | + uses: actions/setup-python@v5 |
| 54 | + with: |
| 55 | + python-version: '3.11' |
| 56 | + |
| 57 | + - name: Install dependencies |
| 58 | + run: | |
| 59 | + python -m pip install --upgrade pip |
| 60 | + pip install black isort flake8 |
| 61 | + |
| 62 | + - name: Check formatting with black |
| 63 | + run: black --check . || true |
| 64 | + |
| 65 | + - name: Check import sorting with isort |
| 66 | + run: isort --check-only . || true |
0 commit comments