Corrective implementation of implementation.md (containerized Django/Wagtail) #3
@@ -4,39 +4,32 @@ on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.event.pull_request.number || github.ref }}
|
||||
group: ci-pr-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
||||
COMPOSE_PROJECT_NAME: gitea-pr-${{ github.event.pull_request.number || github.run_id }}
|
||||
steps:
|
||||
- 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
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||
|
||||
- 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
|
||||
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
|
||||
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:
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.event.pull_request.number || github.ref }}
|
||||
group: ci-pr-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
||||
COMPOSE_PROJECT_NAME: gh-pr-${{ github.event.pull_request.number || github.run_id }}
|
||||
steps:
|
||||
- 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
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||
|
||||
- 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
|
||||
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
|
||||
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:
|
||||
web:
|
||||
build: .
|
||||
working_dir: /app
|
||||
command: python manage.py runserver 0.0.0.0:8000
|
||||
volumes:
|
||||
- .:/app
|
||||
@@ -19,7 +20,8 @@ services:
|
||||
DEFAULT_FROM_EMAIL: hello@nohypeai.com
|
||||
NEWSLETTER_PROVIDER: buttondown
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
@@ -29,6 +31,12 @@ services:
|
||||
POSTGRES_PASSWORD: nohype
|
||||
volumes:
|
||||
- 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:
|
||||
nohype_pg:
|
||||
|
||||
Reference in New Issue
Block a user