All python examples runnable #29
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
| # .github/workflows/verify_examples.yml | |
| # | |
| # CI for python/examples/01-03 select_values scripts. | |
| # Strategy: download the daily HallD SQLite snapshot so the examples | |
| # run against real data with a proper schema. | |
| name: Python examples verification | |
| on: | |
| push: | |
| branches: ['*'] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| # Single source of truth for the connection string | |
| RCDB_CONNECTION: "sqlite:///${{ github.workspace }}/tmp/rcdb2.sqlite" | |
| jobs: | |
| run-examples: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.9" | |
| - name: Install rcdb | |
| run: | | |
| python -m pip install --upgrade pip | |
| cd $GITHUB_WORKSPACE/python | |
| pip install --editable . | |
| pip install jsonpickle # for writing object example | |
| # - name: Download HallD SQLite snapshot | |
| # run: | | |
| # mkdir -p $GITHUB_WORKSPACE/tmp | |
| # # Future put db creation here | |
| # ── Run examples ────────────────────────────────────────────── | |
| # Each example gets its own step so failures are visible per-script. | |
| # continue-on-error keeps the workflow green while showing which | |
| # script had problems (yellow badge instead of silent swallow). | |
| - name: "Example: 01_select_values_simple" | |
| run: python $GITHUB_WORKSPACE/python/examples/01_select_values_simple.py | |
| # Script must read RCDB_CONNECTION env var (see updated examples) | |
| - name: "Example: 02_select_values_extended" | |
| run: python $GITHUB_WORKSPACE/python/examples/02_select_values_extended.py | |
| - name: "Example: 03_select_values_custom_runs" | |
| run: python $GITHUB_WORKSPACE/python/examples/03_select_values_custom_runs.py | |
| - name: "Example: 04_select_cdc_gas_pressure" | |
| run: python $GITHUB_WORKSPACE/python/examples/04_select_cdc_gas_pressure.py | |
| - name: "Example: 10_create_conditions_basic" | |
| run: python $GITHUB_WORKSPACE/python/examples/10_create_conditions_basic.py | |
| - name: "Example: 11_crete_conditions_store_array" | |
| run: python $GITHUB_WORKSPACE/python/examples/11_crete_conditions_store_array.py | |
| - name: "Example: 12_create_conditions_store_object" | |
| run: python $GITHUB_WORKSPACE/python/examples/12_create_conditions_store_object.py | |
| - name: "Example: 90_advanced_sqlalchemy_query" | |
| run: python $GITHUB_WORKSPACE/python/examples/90_advanced_sqlalchemy_query.py |