|
| 1 | +# Simplified CI workflow - rename to ci.yml if you prefer faster CI runs |
| 2 | +# This tests only on the latest OS versions with Python 3.10-3.12 |
| 3 | + |
| 4 | +name: CI |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ main, master, develop ] |
| 9 | + pull_request: |
| 10 | + branches: [ main, master ] |
| 11 | + |
| 12 | +jobs: |
| 13 | + test: |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 19 | + python-version: ['3.10', '3.11', '3.12'] |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Set up Python ${{ matrix.python-version }} |
| 25 | + uses: actions/setup-python@v5 |
| 26 | + with: |
| 27 | + python-version: ${{ matrix.python-version }} |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + run: | |
| 31 | + python -m pip install --upgrade pip |
| 32 | + pip install -e . |
| 33 | + pip install pytest pytest-cov flake8 black mypy |
| 34 | + |
| 35 | + - name: Lint with flake8 |
| 36 | + run: | |
| 37 | + # stop the build if there are Python syntax errors or undefined names |
| 38 | + flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics |
| 39 | + # exit-zero treats all errors as warnings |
| 40 | + flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 41 | + |
| 42 | + - name: Format check with black |
| 43 | + run: | |
| 44 | + black --check src/ |
| 45 | + |
| 46 | + - name: Type check with mypy |
| 47 | + run: | |
| 48 | + mypy src/ --ignore-missing-imports |
| 49 | + |
| 50 | + - name: Test with pytest |
| 51 | + run: | |
| 52 | + pytest tests/ -v --cov=src/gpp_decrypt --cov-report=xml --cov-report=term |
| 53 | + |
| 54 | + - name: Upload coverage reports to Codecov |
| 55 | + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' |
| 56 | + uses: codecov/codecov-action@v4 |
| 57 | + with: |
| 58 | + file: ./coverage.xml |
| 59 | + flags: unittests |
| 60 | + name: codecov-umbrella |
| 61 | + fail_ci_if_error: false |
0 commit comments