Run PR CI via docker build/run without compose networks
All checks were successful
CI / ci (pull_request) Successful in 43s
All checks were successful
CI / ci (pull_request) Successful in 43s
This commit is contained in:
15
.dockerignore
Normal file
15
.dockerignore
Normal file
@@ -0,0 +1,15 @@
|
||||
.git
|
||||
.gitea
|
||||
.github
|
||||
.venv
|
||||
__pycache__/
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.pyd
|
||||
.pytest_cache/
|
||||
.mypy_cache/
|
||||
.ruff_cache/
|
||||
.coverage
|
||||
.benchmarks/
|
||||
media/
|
||||
staticfiles/
|
||||
@@ -11,25 +11,22 @@ jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
COMPOSE_PROJECT_NAME: gitea-pr-${{ github.event.pull_request.number || github.run_id }}
|
||||
CI_IMAGE: nohype-ci:${{ 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
|
||||
run: docker build -t "$CI_IMAGE" .
|
||||
|
||||
- name: Ruff
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --no-deps web ruff check .
|
||||
run: docker run --rm "$CI_IMAGE" ruff check .
|
||||
|
||||
- name: Mypy
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --no-deps web mypy apps config
|
||||
run: docker run --rm "$CI_IMAGE" mypy apps config
|
||||
|
||||
- name: Pytest
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web pytest
|
||||
run: docker run --rm -e DATABASE_URL=sqlite:////tmp/ci.sqlite3 "$CI_IMAGE" pytest
|
||||
|
||||
- name: Final cleanup
|
||||
- name: Remove CI image
|
||||
if: always()
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml down -v --remove-orphans || true
|
||||
run: docker image rm -f "$CI_IMAGE" || true
|
||||
|
||||
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@@ -11,25 +11,22 @@ jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
COMPOSE_PROJECT_NAME: gh-pr-${{ github.event.pull_request.number || github.run_id }}
|
||||
CI_IMAGE: nohype-ci:${{ 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
|
||||
run: docker build -t "$CI_IMAGE" .
|
||||
|
||||
- name: Ruff
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --no-deps web ruff check .
|
||||
run: docker run --rm "$CI_IMAGE" ruff check .
|
||||
|
||||
- name: Mypy
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --no-deps web mypy apps config
|
||||
run: docker run --rm "$CI_IMAGE" mypy apps config
|
||||
|
||||
- name: Pytest
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm web pytest
|
||||
run: docker run --rm -e DATABASE_URL=sqlite:////tmp/ci.sqlite3 "$CI_IMAGE" pytest
|
||||
|
||||
- name: Final cleanup
|
||||
- name: Remove CI image
|
||||
if: always()
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml down -v --remove-orphans || true
|
||||
run: docker image rm -f "$CI_IMAGE" || true
|
||||
|
||||
Reference in New Issue
Block a user