-
Notifications
You must be signed in to change notification settings - Fork 18
59 lines (47 loc) · 2 KB
/
Copy pathpython-examples.yml
File metadata and controls
59 lines (47 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Python examples
on:
push:
pull_request:
branches: [v2-main]
jobs:
run-examples:
runs-on: ubuntu-latest
env:
CCDB_HOME: ${{ github.workspace }}
CCDB_CONNECTION: "sqlite:///${{ github.workspace }}/examples.sqlite"
CCDB_USER: test_user
steps:
- uses: actions/checkout@v7
# 3.9 on purpose: proves examples run on the lowest supported python
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.9"
- name: Install ccdb with examples extras
run: pip install ".[examples]"
- name: Create database (ccdb db init)
run: ccdb db init --init-i-am-sure
- name: example_llapi_readout
working-directory: python
run: python examples/example_llapi_readout.py
- name: example_llapi_change_value
working-directory: python
run: python examples/example_llapi_change_value.py
- name: example_llapi_variations
working-directory: python
run: python examples/example_llapi_variations.py
- name: example_llapi_copy
working-directory: python
run: python examples/example_llapi_copy.py
# This example documents its own prerequisite: the custom_data table
- name: example_llapi_add_custom_data
working-directory: python
run: |
ccdb mktbl /test/test_vars/custom_data -r 1 xml_data=string "#Store xml in ccdb"
python examples/example_llapi_add_custom_data.py
# SKIPPED examples (cannot run in CI):
# example_halld_connect.py - connects to the JLab HallD MySQL server (network/VPN)
# example_llapi_edit_assignment.py - snippet with hardcoded /home/user paths, not runnable as-is
# example_run_period_to_pandas.py - needs HallD run-period data absent from the standard test DB
- name: List skipped examples
run: echo "Skipped (need JLab MySQL or HallD data) - example_halld_connect, example_llapi_edit_assignment, example_run_period_to_pandas"