|
| 1 | +name: CI Pipeline |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - '**' # Optional: Run for all branches |
| 8 | + pull_request: |
| 9 | + |
| 10 | +jobs: |
| 11 | + test: |
| 12 | + name: Run Unit Tests |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + python-version: [3.8, 3.9, 3.10, 3.11, 3.12, 3.13] |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v3 |
| 19 | + - name: Set up Python |
| 20 | + uses: actions/setup-python@v4 |
| 21 | + with: |
| 22 | + python-version: ${{ matrix.python-version }} |
| 23 | + - name: Cache pip |
| 24 | + uses: actions/cache@v3 |
| 25 | + with: |
| 26 | + path: .cache/pip |
| 27 | + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }} |
| 28 | + - name: Install dependencies |
| 29 | + run: pip install -r requirements.txt |
| 30 | + - name: Run Unit Tests |
| 31 | + run: python -m unittest |
| 32 | + |
| 33 | + coverage: |
| 34 | + name: Test Coverage |
| 35 | + runs-on: ubuntu-latest |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + python-version: [3.7, 3.8, 3.9, 3.10, 3.11] |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v3 |
| 41 | + - name: Set up Python |
| 42 | + uses: actions/setup-python@v4 |
| 43 | + with: |
| 44 | + python-version: ${{ matrix.python-version }} |
| 45 | + - name: Install dependencies |
| 46 | + run: | |
| 47 | + pip install -r requirements.txt |
| 48 | + pip install coverage |
| 49 | + - name: Run Coverage |
| 50 | + run: | |
| 51 | + coverage run -m unittest discover |
| 52 | + coverage xml |
| 53 | + coverage html |
| 54 | + coverage report -m --fail-under=93 |
| 55 | + - name: Upload Coverage Report |
| 56 | + uses: actions/upload-artifact@v3 |
| 57 | + with: |
| 58 | + name: coverage-reports-${{ matrix.python-version }} |
| 59 | + path: | |
| 60 | + coverage.xml |
| 61 | + htmlcov |
| 62 | +
|
| 63 | + flake8: |
| 64 | + name: Run Flake8 |
| 65 | + runs-on: ubuntu-latest |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v3 |
| 68 | + - name: Set up Python |
| 69 | + uses: actions/setup-python@v4 |
| 70 | + with: |
| 71 | + python-version: 3.13 |
| 72 | + - name: Install dependencies |
| 73 | + run: | |
| 74 | + pip install -r requirements.txt |
| 75 | + pip install flake8 |
| 76 | + - name: Run Flake8 |
| 77 | + run: flake8 --ignore E501,E226,W503 --exclude=src/... src/ |
| 78 | + |
| 79 | + pylint: |
| 80 | + name: Run Pylint |
| 81 | + runs-on: ubuntu-latest |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v3 |
| 84 | + - name: Set up Python |
| 85 | + uses: actions/setup-python@v4 |
| 86 | + with: |
| 87 | + python-version: 3.13 |
| 88 | + - name: Install dependencies |
| 89 | + run: | |
| 90 | + pip install -r requirements.txt |
| 91 | + pip install pylint |
| 92 | + - name: Run Pylint |
| 93 | + run: pylint src/... --fail-under=9.49 |
| 94 | + |
| 95 | + build_wheel: |
| 96 | + name: Build Python Wheel |
| 97 | + runs-on: ubuntu-latest |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v3 |
| 100 | + - name: Set up Python |
| 101 | + uses: actions/setup-python@v4 |
| 102 | + with: |
| 103 | + python-version: 3.13 |
| 104 | + - name: Install dependencies |
| 105 | + run: | |
| 106 | + pip install -r requirements.txt |
| 107 | + pip install build |
| 108 | + - name: Build Wheel |
| 109 | + run: python -m build |
| 110 | + - name: Upload Wheel |
| 111 | + uses: actions/upload-artifact@v3 |
| 112 | + with: |
| 113 | + name: python-wheels |
| 114 | + path: dist/*.whl |
0 commit comments