CI: isolate compose projects and remove runner container conflicts
This commit is contained in:
@@ -10,27 +10,33 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker compose build
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||||
- name: Ruff
|
- name: Ruff
|
||||||
run: docker compose run --rm web ruff check .
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web ruff check .
|
||||||
|
|
||||||
typecheck:
|
typecheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker compose build
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||||
- name: Mypy
|
- name: Mypy
|
||||||
run: docker compose run --rm web mypy apps config
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web mypy apps config
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker compose build
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||||
- name: Pytest
|
- name: Pytest
|
||||||
run: docker compose run --rm web pytest
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web pytest
|
||||||
|
|||||||
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@@ -10,27 +10,33 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker compose build
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||||
- name: Ruff
|
- name: Ruff
|
||||||
run: docker compose run --rm web ruff check .
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web ruff check .
|
||||||
|
|
||||||
typecheck:
|
typecheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker compose build
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||||
- name: Mypy
|
- name: Mypy
|
||||||
run: docker compose run --rm web mypy apps config
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web mypy apps config
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
COMPOSE_PROJECT_NAME: ci-${{ github.run_id }}-${{ github.job }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker compose build
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||||
- name: Pytest
|
- name: Pytest
|
||||||
run: docker compose run --rm web pytest
|
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web pytest
|
||||||
|
|||||||
7
docker-compose.ci.yml
Normal file
7
docker-compose.ci.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
services:
|
||||||
|
web:
|
||||||
|
volumes: []
|
||||||
|
ports: []
|
||||||
|
|
||||||
|
db:
|
||||||
|
ports: []
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
container_name: nohype-web
|
|
||||||
command: python manage.py runserver 0.0.0.0:8000
|
command: python manage.py runserver 0.0.0.0:8000
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
@@ -24,13 +23,10 @@ services:
|
|||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
container_name: nohype-db
|
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: nohype
|
POSTGRES_DB: nohype
|
||||||
POSTGRES_USER: nohype
|
POSTGRES_USER: nohype
|
||||||
POSTGRES_PASSWORD: nohype
|
POSTGRES_PASSWORD: nohype
|
||||||
ports:
|
|
||||||
- "5545:5432"
|
|
||||||
volumes:
|
volumes:
|
||||||
- nohype_pg:/var/lib/postgresql/data
|
- nohype_pg:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user