/ .github / workflows / tests.yml
tests.yml
 1  name: Run Tests
 2  
 3  on:
 4    push:
 5      branches: [ main, master ]
 6    pull_request:
 7      branches: [ main, master ]
 8      types: [opened, synchronize, reopened]
 9  
10  jobs:
11    test:
12      strategy:
13        matrix:
14          python-version: ["3.11", "3.12"]
15          os: [ubuntu-latest, windows-latest, macos-latest]
16  
17      runs-on: ${{ matrix.os }}
18      
19      steps:
20      - uses: actions/checkout@v4
21  
22      - name: Set up Python ${{ matrix.python-version }}
23        uses: actions/setup-python@v5
24        with:
25          python-version: ${{ matrix.python-version }}
26  
27      - name: Install uv (Linux/macOS)
28        if: runner.os != 'Windows'
29        run: |
30          curl -LsSf https://astral.sh/uv/install.sh | sh
31          echo "$HOME/.cargo/bin" >> $GITHUB_PATH
32          
33      - name: Install uv (Windows)
34        if: runner.os == 'Windows'
35        run: |
36          # Install uv
37          iwr -useb https://astral.sh/uv/install.ps1 | iex
38          # Add uv to PATH
39          echo "$HOME\.uv\bin" >> $GITHUB_PATH
40  
41      - name: Install dependencies
42        run: |
43          uv pip install --system pytest pytest-cov pytest-asyncio
44          uv pip install --system -e ".[test]"
45          # If you don't have a [test] extra, use:
46          # uv pip install --system -r requirements-test.txt
47          # or just:
48          # uv pip install --system -e .
49  
50      # Run tests differently based on platform
51      - name: Run tests on Linux/macOS
52        if: runner.os != 'Windows'
53        run: |
54          pytest --cov=./ --cov-report=xml -v
55          
56      - name: Run tests on Windows
57        if: runner.os == 'Windows' 
58        run: |
59          pytest --cov=./ --cov-report=xml -v
60  
61