rm prof #1297
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python package tests | |
on: | |
push: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
schedule: | |
- cron: "0 12 * * 1" | |
pull_request_target: | |
types: [opened, synchronize, reopened, ready_for_review] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 # Add timeout to prevent hanging | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Cache pip dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache pytest | |
uses: actions/cache@v3 | |
with: | |
path: .pytest_cache | |
key: ${{ runner.os }}-pytest-${{ hashFiles('**/pytest.ini') }} | |
restore-keys: | | |
${{ runner.os }}-pytest- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
# Install the package with dev dependencies | |
pip install -e ".[dev]" | |
# Install test dependencies | |
pip install pytest pytest-cov pytest-xdist pytest-timeout | |
- name: Set up environment | |
run: | | |
echo "HF_TOKEN=${{ vars.HF_TOKEN }}" > .env | |
- name: Run tests | |
run: | | |
pytest -vv \ | |
--durations=10 \ | |
-n 2 \ | |
--timeout=300 \ | |
--cov=quartz_solar_forecast \ | |
--cov-report=xml \ | |
--cov-report=term-missing \ | |
-p no:profiling # Disable profiling temporarily | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-report | |
path: | | |
coverage.xml | |
.coverage |