Skip to content

Commit b79f40b

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

2 files changed

Lines changed: 124 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'Set up RDMO test environment'
2+
description: 'Checks out rdmo-app, installs rdmo, configures the app, and creates a superuser.'
3+
4+
inputs:
5+
path:
6+
description: 'Path where the rdmo-app is set up'
7+
required: false
8+
default: '.rdmo'
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Checkout rdmo-app
14+
uses: actions/checkout@v6
15+
with:
16+
repository: rdmorganiser/rdmo-app
17+
path: ${{ inputs.path }}/rdmo-app
18+
persist-credentials: false
19+
20+
- name: Install rdmo
21+
shell: bash
22+
run: pip install -e rdmo
23+
24+
- name: Configure rdmo-app settings
25+
shell: bash
26+
working-directory: ${{ inputs.path }}/rdmo-app
27+
run: |
28+
cat >> config/settings/local.py <<'EOF'
29+
DEBUG = True
30+
ALLOWED_HOSTS = ['localhost']
31+
SECRET_KEY = 'not a very secret key'
32+
EOF
33+
34+
- name: Run migrations
35+
shell: bash
36+
working-directory: ${{ inputs.path }}/rdmo-app
37+
run: ./manage.py migrate
38+
39+
- name: Create superuser
40+
shell: bash
41+
working-directory: ${{ inputs.path }}/rdmo-app
42+
env:
43+
DJANGO_SUPERUSER_PASSWORD: admin
44+
run: ./manage.py createsuperuser --noinput --username admin --email admin@example.com

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
- name: Checkout repo 🛎️
33+
uses: actions/checkout@v6
34+
with:
35+
persist-credentials: false
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ env.PYTHON_VERSION }}
41+
cache: 'pip'
42+
43+
- name: Set up RDMO test environment
44+
uses: .github/actions/setup-rdmo
45+
with:
46+
path: .rdmo
47+
48+
- name: Install plugin
49+
run: pip install -e .
50+
51+
- name: Configure plugin
52+
working-directory: .rdmo/rdmo-app
53+
run: |
54+
cat >> config/settings/local.py <<'EOF'
55+
INSTALLED_APPS = ['rdmo_llm_views', 'django_q', *INSTALLED_APPS]
56+
57+
LLM_VIEWS_ADAPTER = 'rdmo_llm_views.adapter.OpenAILangChainAdapter'
58+
LLM_VIEWS_LLM_ARGS = {}
59+
60+
LLM_VIEWS_SELECT_MODEL = True
61+
LLM_VIEWS_TIMEOUT = 4000
62+
63+
Q_CLUSTER = {
64+
'name': 'DjangORM',
65+
'workers': 1,
66+
'timeout': 900,
67+
'retry': 120,
68+
'queue_limit': 1,
69+
'bulk': 1,
70+
'orm': 'default'
71+
}
72+
EOF
73+
74+
- name: Run migrations
75+
working-directory: .rdmo/rdmo-app
76+
run: ./manage.py migrate
77+
78+
- name: Run Django system checks
79+
working-directory: .rdmo/rdmo-app
80+
run: ./manage.py check

0 commit comments

Comments
 (0)