---
name: Test

on:
  push:
    branches:
      - main
      - renovate/**
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version:
          - "3.13"
          - "3.14"

    steps:
      - uses: actions/checkout@v5
      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          python-version: ${{ matrix.python-version }}
          enable-cache: true
          cache-dependency-glob: "requirements_dev.txt"
          activate-environment: true
      - name: Install dependencies
        run: |
          uv pip install -r requirements_dev.txt
      - name: Test with pytest
        run: |
          pytest --cov=gcal_sync --cov-report=term-missing
      - uses: codecov/codecov-action@v5.5.1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          env_vars: OS,PYTHON
          fail_ci_if_error: true
          verbose: true
