Reliability/performance upgrade: EV/BESS/PV fixes, three-phase constraints, community settlement and internal refactor #43
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install lint dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff | |
| - name: Lint (critical rules) | |
| run: | | |
| python -m ruff check citylearn tests scripts/manual scripts/ci --select E9,F821 | |
| test: | |
| needs: lint | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.10"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| 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', 'test_requirements.txt', 'setup.py') }} | |
| restore-keys: | | |
| ${{ runner.os }}-py${{ matrix.python-version }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r test_requirements.txt | |
| pip install -e . | |
| - name: Run tests | |
| run: python -m pytest -q --ignore=scripts/manual | |
| - name: Performance smoke check | |
| if: matrix.python-version == '3.10' | |
| run: | | |
| mkdir -p ${{ runner.temp }}/perf | |
| python scripts/ci/perf_smoke.py \ | |
| --episode-steps 600 \ | |
| --seconds 60 \ | |
| --none-max-ms 30 \ | |
| --end-max-ms 45 \ | |
| --ratio-max 2.0 \ | |
| --baseline-file scripts/ci/perf_baseline.json \ | |
| --baseline-regression-ratio 3.0 \ | |
| --baseline-slack-ms 10.0 \ | |
| --metrics-output ${{ runner.temp }}/perf/perf_smoke_report.json | |
| - name: Upload performance smoke report | |
| if: always() && matrix.python-version == '3.10' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: perf-smoke-report | |
| path: ${{ runner.temp }}/perf/perf_smoke_report.json | |
| if-no-files-found: ignore |