Skip to content

Commit d24f045

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

2 files changed

Lines changed: 117 additions & 0 deletions

File tree

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

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 with RDMO dev setup
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-app for testing
44+
# uses: rdmorganiser/.github/actions/setup-rdmo@setup-action
45+
uses: .github/actions/setup-rdmo
46+
47+
- name: Install plugin
48+
run: pip install -e .
49+
50+
- name: Configure plugin
51+
working-directory: rdmo-app
52+
run: |
53+
cat >> config/settings/local.py <<'EOF'
54+
INSTALLED_APPS = ['rdmo_llm_views', 'django_q', *INSTALLED_APPS]
55+
56+
LLM_VIEWS_ADAPTER = 'rdmo_llm_views.adapter.OpenAILangChainAdapter'
57+
LLM_VIEWS_LLM_ARGS = {}
58+
59+
LLM_VIEWS_SELECT_MODEL = True
60+
LLM_VIEWS_TIMEOUT = 4000
61+
62+
Q_CLUSTER = {
63+
'name': 'DjangORM',
64+
'workers': 1,
65+
'timeout': 900,
66+
'retry': 120,
67+
'queue_limit': 1,
68+
'bulk': 1,
69+
'orm': 'default'
70+
}
71+
EOF
72+
73+
- name: Run migrations
74+
working-directory: rdmo-app
75+
run: ./manage.py migrate
76+
77+
- name: Run Django system checks
78+
working-directory: rdmo-app
79+
run: ./manage.py check

0 commit comments

Comments
 (0)