Skip to content

Commit 1f17d3f

Browse files
committed
Add GitHub workflow
1 parent cb168a3 commit 1f17d3f

1 file changed

Lines changed: 89 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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: Run migrations
78+
working-directory: rdmo-app
79+
run: ./manage.py migrate
80+
81+
- name: Create superuser
82+
working-directory: rdmo-app
83+
env:
84+
DJANGO_SUPERUSER_PASSWORD: admin
85+
run: ./manage.py createsuperuser --noinput --username admin --email admin@example.com
86+
87+
- name: Run Django system checks
88+
working-directory: rdmo-app
89+
run: ./manage.py check

0 commit comments

Comments
 (0)