Skip to content

Commit f3dc84f

Browse files
authored
Merge pull request #15 from G4brym/add-ci-and-update-agents-md
feat: Add GitHub Actions CI and update AGENTS.md
2 parents 0d5a057 + 769e4ba commit f3dc84f

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Run Pytest
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.10", "3.11", "3.12"]
11+
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
21+
- name: Install Python dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -e .[dev]
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20' # Specify a Node.js version
30+
31+
- name: Install root Node.js dependencies
32+
run: npm install
33+
34+
- name: Install worker Node.js dependencies
35+
run: cd templates/durable-objects && npm install
36+
37+
- name: Run tests
38+
run: pytest tests/

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ This document provides guidance for AI agents working on the `django-cf` reposit
6565
* Ensure `npm install` completed successfully in `templates/durable-objects/`.
6666
* Verify that the port selected by `get_free_port()` is indeed available.
6767
* **`ImportError: attempted relative import with no known parent package`**: Ensure `tests/__init__.py` exists.
68+
* **`no tests ran` when running `pytest`**: Ensure you are running `pytest` from the root directory of the project. If you are in a subdirectory (e.g., `templates/durable-objects/`), `pytest` might not discover the tests in the `tests/` directory. Running `pytest tests/` from the root should correctly discover and run the tests.
6869
* **CSRF token issues**: The `get_csrf_token` helper in `tests/test_admin.py` is a basic string parser. If Django admin templates change significantly, this helper might need updating (e.g., to use a proper HTML parser).
6970

71+
### Continuous Integration
72+
73+
A GitHub Actions workflow is configured in `.github/workflows/ci.yml`. This workflow automatically runs all tests using `pytest` on every push to any branch. It tests against Python versions 3.10, 3.11, and 3.12.
74+
7075
By following these guidelines, agents can contribute effectively to this repository.

0 commit comments

Comments
 (0)