-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
Close #236
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
dotenv devops/envs/local/django | ||
dotenv devops/envs/local/pycharm | ||
|
||
layout poetry | ||
uv sync | ||
source .venv/bin/activate |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,49 +19,59 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
linter: | ||
runner-job: | ||
runs-on: ubuntu-latest | ||
services: | ||
# Label used to access the service container | ||
postgres: | ||
# Docker Hub image | ||
image: postgres | ||
# Provide the password for postgres | ||
env: | ||
POSTGRES_HOST: postgres | ||
POSTGRES_PORT: 5432 | ||
POSTGRES_DB: legadilo | ||
POSTGRES_USER: django | ||
POSTGRES_PASSWORD: django_passwd | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
# Maps tcp port 5432 on service container to the host | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
python-version: "3.12" | ||
# Install a specific version of uv. | ||
version: "0.5.8" | ||
|
||
- name: Install poetry | ||
run: pip install poetry==1.8.2 | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
|
||
- name: Install typing deps | ||
run: poetry install --with typing | ||
- name: Install the project | ||
run: uv sync --dev --locked | ||
|
||
# Consider using pre-commit.ci for open source project | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
# With no caching at all the entire ci process takes 4m 30s to complete! | ||
pytest: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build the Stack | ||
run: docker compose -f local.yml build | ||
run: uv run pre-commit run -a | ||
|
||
- name: Create cache table | ||
run: docker compose -f local.yml run --rm django python manage.py createcachetable | ||
run: uv run python manage.py createcachetable | ||
|
||
- name: Run DB Migrations | ||
run: docker compose -f local.yml run --rm django python manage.py migrate | ||
run: uv run python manage.py migrate | ||
|
||
- name: Run Django Tests | ||
run: docker compose -f local.yml run --rm django pytest --cov --cov-report term:skip-covered --cov-fail-under=90 | ||
|
||
- name: Tear down the Stack | ||
run: docker compose -f local.yml down | ||
run: uv run pytest --cov --cov-report term:skip-covered --cov-fail-under=90 | ||
|
||
- name: Test build production images | ||
run: | | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ set -o errexit | |
set -o pipefail | ||
set -o nounset | ||
|
||
exec make livehtml | ||
exec uv run make livehtml |