name: CI on: push: branches: [ main, develop ] paths-ignore: - '**.md' - 'docs/**' - 'LICENSE' pull_request: branches: [ main ] paths-ignore: - '**.md' - 'docs/**' - 'LICENSE' env: PYTHONUNBUFFERED: "1" jobs: test: name: Test (Python ${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: python-version: ["3.10", "3.11"] os: [ubuntu-latest] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Cache pip dependencies uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }} restore-keys: | ${{ runner.os }}-py${{ matrix.python-version }}-pip- - name: Install dependencies run: | python -m pip install --upgrade pip pip install -e ".[test]" pip install -r requirements.txt - name: List installed packages run: pip list - name: Run tests with coverage run: | pytest test/ \ -v \ --cov=rdagent \ --cov-report=xml \ --cov-report=html \ --cov-report=term-missing \ --durations=10 \ -x - name: Upload coverage to Codecov if: matrix.python-version == '3.10' && github.ref == 'refs/heads/main' uses: codecov/codecov-action@v4 with: file: ./coverage.xml flags: unittests name: codecov-umbrella fail_ci_if_error: false env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage HTML report if: always() uses: actions/upload-artifact@v4 with: name: coverage-html-report-py${{ matrix.python-version }} path: htmlcov/ retention-days: 7