Corrective implementation of implementation.md (containerized Django/Wagtail) #3
@@ -4,39 +4,32 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ci-${{ github.event.pull_request.number || github.ref }}
|
group: ci-pr-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
ci:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
COMPOSE_PROJECT_NAME: gitea-pr-${{ github.event.pull_request.number || github.run_id }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Clean previous compose project
|
||||||
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml down -v --remove-orphans || true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||||
|
|
||||||
- name: Ruff
|
- name: Ruff
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web ruff check .
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --no-deps web ruff check .
|
||||||
|
|
||||||
typecheck:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Build
|
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
|
||||||
- name: Mypy
|
- name: Mypy
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web mypy apps config
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --no-deps web mypy apps config
|
||||||
|
|
||||||
tests:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Build
|
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
|
||||||
- name: Pytest
|
- name: Pytest
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web pytest
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web pytest
|
||||||
|
|
||||||
|
- name: Final cleanup
|
||||||
|
if: always()
|
||||||
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml down -v --remove-orphans || true
|
||||||
|
|||||||
35
.github/workflows/ci.yml
vendored
35
.github/workflows/ci.yml
vendored
@@ -4,39 +4,32 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ci-${{ github.event.pull_request.number || github.ref }}
|
group: ci-pr-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
ci:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
COMPOSE_PROJECT_NAME: gh-pr-${{ github.event.pull_request.number || github.run_id }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Clean previous compose project
|
||||||
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml down -v --remove-orphans || true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||||
|
|
||||||
- name: Ruff
|
- name: Ruff
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web ruff check .
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --no-deps web ruff check .
|
||||||
|
|
||||||
typecheck:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Build
|
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
|
||||||
- name: Mypy
|
- name: Mypy
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web mypy apps config
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --no-deps web mypy apps config
|
||||||
|
|
||||||
tests:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Build
|
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
|
||||||
- name: Pytest
|
- name: Pytest
|
||||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web pytest
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web pytest
|
||||||
|
|
||||||
|
- name: Final cleanup
|
||||||
|
if: always()
|
||||||
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml down -v --remove-orphans || true
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
|
working_dir: /app
|
||||||
command: python manage.py runserver 0.0.0.0:8000
|
command: python manage.py runserver 0.0.0.0:8000
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
@@ -19,7 +20,8 @@ services:
|
|||||||
DEFAULT_FROM_EMAIL: hello@nohypeai.com
|
DEFAULT_FROM_EMAIL: hello@nohypeai.com
|
||||||
NEWSLETTER_PROVIDER: buttondown
|
NEWSLETTER_PROVIDER: buttondown
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
@@ -29,6 +31,12 @@ services:
|
|||||||
POSTGRES_PASSWORD: nohype
|
POSTGRES_PASSWORD: nohype
|
||||||
volumes:
|
volumes:
|
||||||
- nohype_pg:/var/lib/postgresql/data
|
- nohype_pg:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U nohype -d nohype"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
start_period: 5s
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
nohype_pg:
|
nohype_pg:
|
||||||
|
|||||||
Reference in New Issue
Block a user