|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, develop ] |
| 6 | + pull_request: |
| 7 | + branches: [ main, develop ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + name: Test Python ${{ matrix.python-version }} |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 17 | + python-version: ['3.9', '3.10', '3.11', '3.12'] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Set up Node.js |
| 23 | + uses: actions/setup-node@v4 |
| 24 | + with: |
| 25 | + node-version: '18' |
| 26 | + |
| 27 | + - name: Install Node.js dependencies |
| 28 | + run: npm install |
| 29 | + |
| 30 | + - name: Set up Python ${{ matrix.python-version }} |
| 31 | + uses: actions/setup-python@v5 |
| 32 | + with: |
| 33 | + python-version: ${{ matrix.python-version }} |
| 34 | + |
| 35 | + - name: Install Python dependencies |
| 36 | + run: | |
| 37 | + python -m pip install --upgrade pip |
| 38 | + pip install -e ".[dev]" |
| 39 | + |
| 40 | + - name: Run tests |
| 41 | + run: pytest tests/ -v --cov=vortex_sdk --cov-report=xml |
| 42 | + |
| 43 | + - name: Upload coverage to Codecov |
| 44 | + uses: codecov/codecov-action@v3 |
| 45 | + with: |
| 46 | + file: ./coverage.xml |
| 47 | + flags: unittests |
| 48 | + name: codecov-umbrella |
| 49 | + fail_ci_if_error: false |
| 50 | + |
| 51 | + lint: |
| 52 | + name: Lint and Type Check |
| 53 | + runs-on: ubuntu-latest |
| 54 | + |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v4 |
| 57 | + |
| 58 | + - name: Set up Python |
| 59 | + uses: actions/setup-python@v5 |
| 60 | + with: |
| 61 | + python-version: '3.9' |
| 62 | + |
| 63 | + - name: Install dependencies |
| 64 | + run: | |
| 65 | + python -m pip install --upgrade pip |
| 66 | + pip install -e ".[dev]" |
| 67 | + |
| 68 | + - name: Run black |
| 69 | + run: black --check src/ tests/ examples/ |
| 70 | + |
| 71 | + - name: Run ruff |
| 72 | + run: ruff check src/ tests/ examples/ |
| 73 | + |
| 74 | + - name: Run mypy |
| 75 | + run: mypy src/ |
0 commit comments