|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + - uses: actions/setup-python@v5 |
| 15 | + with: |
| 16 | + python-version: "3.12" |
| 17 | + - name: Install dependencies |
| 18 | + run: | |
| 19 | + python -m pip install --upgrade pip |
| 20 | + pip install ruff mypy |
| 21 | + pip install -e ".[dev]" |
| 22 | + - name: Run Ruff linter |
| 23 | + run: ruff check src/ |
| 24 | + - name: Run Ruff formatter check |
| 25 | + run: ruff format --check src/ |
| 26 | + - name: Run MyPy |
| 27 | + run: mypy src/omophub |
| 28 | + |
| 29 | + test: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + strategy: |
| 32 | + matrix: |
| 33 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + - uses: actions/setup-python@v5 |
| 37 | + with: |
| 38 | + python-version: ${{ matrix.python-version }} |
| 39 | + - name: Install dependencies |
| 40 | + run: | |
| 41 | + python -m pip install --upgrade pip |
| 42 | + pip install -e ".[dev]" |
| 43 | + - name: Run unit tests with coverage |
| 44 | + run: | |
| 45 | + pytest tests/unit --cov=omophub --cov-report=xml --cov-report=term-missing |
| 46 | + - name: Upload coverage to Codecov |
| 47 | + if: matrix.python-version == '3.12' |
| 48 | + uses: codecov/codecov-action@v4 |
| 49 | + with: |
| 50 | + files: ./coverage.xml |
| 51 | + fail_ci_if_error: false |
| 52 | + |
| 53 | + integration: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v4 |
| 57 | + - uses: actions/setup-python@v5 |
| 58 | + with: |
| 59 | + python-version: "3.12" |
| 60 | + - name: Install dependencies |
| 61 | + run: | |
| 62 | + python -m pip install --upgrade pip |
| 63 | + pip install -e ".[dev]" |
| 64 | + - name: Run integration tests |
| 65 | + env: |
| 66 | + TEST_API_KEY: ${{ secrets.TEST_API_KEY }} |
| 67 | + run: | |
| 68 | + pytest tests/integration -v |
0 commit comments