Skip to content

Commit e1f90fd

Browse files
committed
Add GitHub workflow
1 parent 26b3bc4 commit e1f90fd

1 file changed

Lines changed: 112 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: CI
2+
3+
# Triggers: when this workflow runs
4+
on:
5+
push:
6+
branches:
7+
- main # run on pushes to main
8+
- test # run on pushes to test
9+
tags:
10+
- "*" # run on any tag push (useful for releases)
11+
pull_request:
12+
branches:
13+
- main # run on PRs targeting main
14+
workflow_dispatch: # allow manual runs from the Actions tab
15+
16+
# Cancel in-progress runs when a new commit is pushed to the same ref.
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
# Start with zero permissions; grant per-job what's actually needed.
22+
permissions: {}
23+
24+
env:
25+
PYTHON_VERSION: '3.12'
26+
27+
jobs:
28+
check:
29+
name: Check if the plugin can be used with RDMO
30+
runs-on: ubuntu-slim
31+
steps:
32+
33+
- name: Checkout rdmo
34+
uses: actions/checkout@v6
35+
with:
36+
repository: rdmorganiser/rdmo
37+
path: rdmo
38+
persist-credentials: false
39+
40+
- name: Checkout rdmo-app
41+
uses: actions/checkout@v6
42+
with:
43+
repository: rdmorganiser/rdmo-app
44+
path: rdmo-app
45+
persist-credentials: false
46+
47+
- name: Checkout this repo
48+
uses: actions/checkout@v6
49+
with:
50+
path: ${{ github.event.repository.name }}
51+
persist-credentials: false
52+
53+
- name: Set up Python
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: ${{ env.PYTHON_VERSION }}
57+
cache: 'pip'
58+
cache-dependency-path: |
59+
rdmo/pyproject.toml
60+
${{ github.event.repository.name }}/pyproject.toml
61+
62+
- name: Install rdmo
63+
run: pip install -e 'rdmo'
64+
65+
- name: Install plugin
66+
run: pip install -e './${{ github.event.repository.name }}'
67+
68+
- name: Configure rdmo-app settings
69+
working-directory: rdmo-app
70+
run: |
71+
cat >> config/settings/local.py <<'EOF'
72+
DEBUG = True
73+
ALLOWED_HOSTS = ['localhost']
74+
SECRET_KEY = 'not a very secret key'
75+
EOF
76+
77+
- name: Configure plugin
78+
working-directory: rdmo-app
79+
run: |
80+
cat >> config/settings/local.py <<'EOF'
81+
INSTALLED_APPS = ['rdmo_llm_views', 'django_q', *INSTALLED_APPS]
82+
83+
LLM_VIEWS_ADAPTER = 'rdmo_llm_views.adapter.OpenAILangChainAdapter'
84+
LLM_VIEWS_LLM_ARGS = {}
85+
86+
LLM_VIEWS_SELECT_MODEL = True
87+
LLM_VIEWS_TIMEOUT = 4000
88+
89+
Q_CLUSTER = {
90+
'name': 'DjangORM',
91+
'workers': 1,
92+
'timeout': 900,
93+
'retry': 120,
94+
'queue_limit': 1,
95+
'bulk': 1,
96+
'orm': 'default'
97+
}
98+
EOF
99+
100+
- name: Run migrations
101+
working-directory: rdmo-app
102+
run: ./manage.py migrate
103+
104+
- name: Create superuser
105+
working-directory: rdmo-app
106+
env:
107+
DJANGO_SUPERUSER_PASSWORD: admin
108+
run: ./manage.py createsuperuser --noinput --username admin --email admin@example.com
109+
110+
- name: Run Django system checks
111+
working-directory: rdmo-app
112+
run: ./manage.py check

0 commit comments

Comments
 (0)