|
| 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 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