Skip to content

Commit

Permalink
tryfix-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
c4ffein committed Aug 5, 2024
1 parent 78d50cd commit 3bda8b9
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test-cypress-api-postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
- name: Run Django
run: |
. venv/bin/activate
# nohup make run DATABASE_URL=postgresql://runner:0000@localhost:5432/db > nohup.out 2> nohup.err < /dev/null &
make run DATABASE_URL=postgresql://runner:0000@localhost:5432/db ALLOWED_HOSTS=* &
sleep 4
- name: Setup Cypress
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/test-cypress-api-sqlite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test Cypress API SQLite

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.12]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install uv
uv venv venv
. venv/bin/activate
uv pip install .[dev]
- name: Migrate
run: |
. venv/bin/activate
DEBUG=True python manage.py migrate
- name: Run Django
run: |
. venv/bin/activate
make run-debug
sleep 4
- name: Setup Cypress
run: |
make setup-cypress
- name: Run Tests
run: |
make test-cypress-api
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ If you want to rebuild the Docker Image:
### Testing
- `make test-django`: Django Ninja tests, uses SQLite by default, specify `DATABASE_URL` to use PostgreSQL.
- `make test-cypress-api`: API Cypress tests (needs the application running).
- `make setup-cypress` is needed to install the dependencies.

### Deploying
A [Django Ninja](https://django-ninja.dev/) project can be deployed just as any [Django](https://www.djangoproject.com/) project.
Expand Down Expand Up @@ -144,12 +145,6 @@ You may check [the opened issues](https://github.com/c4ffein/realworld-django-ni
Seriously, yes, for anything that crosses your mind. This is early-stage, I'll consider any opinion.


## Improvements / still TODO
*I'm not creating specific issues for those as I just hope to finish all that soon enough (I wish), but you may do it if you want:*
- Help about CORS?
- CI with ruff + django tests both postgres and sqlite + cypress API


## License
- The [original code](https://github.com/Sean-Miningah/realWorld-DjangoRestFramework) is a [Django REST framework](https://www.django-rest-framework.org/) project made by [Sean-Miningah](https://github.com/Sean-Miningah/) and released under the [MIT License](https://github.com/Sean-Miningah/realWorld-DjangoRestFramework/blob/master/LICENSE).
- This project is now also released for the most part under the [MIT License](https://github.com/c4ffein/realworld-django-ninja/blob/master/LICENSE) by [c4ffein](https://github.com/c4ffein/).
Expand Down

0 comments on commit 3bda8b9

Please sign in to comment.