diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index ba795b4..ab23843 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -1,8 +1,10 @@ when: - event: push + - event: pull_request + - event: manual steps: - - image: node:lts + - image: node:lts-alpine commands: - npm install - npm run build diff --git a/.woodpecker/lint.yaml b/.woodpecker/lint.yaml index bc25a32..9cb7390 100644 --- a/.woodpecker/lint.yaml +++ b/.woodpecker/lint.yaml @@ -1,19 +1,18 @@ when: - event: push - branch: main - event: pull_request + - event: manual steps: - name: python linting - image: python:3.11 + image: ghcr.io/astral-sh/uv:latest commands: - - pip install uv - uv sync --group ci - - ./.venv/bin/ruff check src/ - - ./.venv/bin/ruff format --check src/ + - uv run --no-sync -- check src/ + - uv run --no-sync -- ruff format --check src/ - name: javascript linting - image: node:lts + image: node:lts-alpine commands: - - npm install + - npm ci - npm run lint diff --git a/.woodpecker/tests.yaml b/.woodpecker/tests.yaml index fed2254..1f39e38 100644 --- a/.woodpecker/tests.yaml +++ b/.woodpecker/tests.yaml @@ -1,36 +1,37 @@ when: - event: push + - event: pull_request + - event: manual services: - name: postgres image: postgres:15 environment: - POSTGRES_NAME: newsreader - POSTGRES_USER: newsreader - POSTGRES_PASSWORD: sekrit + POSTGRES_NAME: &db-name newsreader + POSTGRES_USER: &db-user newsreader + POSTGRES_PASSWORD: &db-password sekrit - name: memcached image: memcached:1.5.22 steps: - name: python tests - image: python:3.11 + image: python:3.11-alpine environment: DJANGO_SETTINGS_MODULE: "newsreader.conf.ci" DJANGO_SECRET_KEY: sekrit POSTGRES_HOST: postgres POSTGRES_PORT: 5432 - POSTGRES_DB: newsreader - POSTGRES_NAME: newsreader - POSTGRES_USER: newsreader - POSTGRES_PASSWORD: sekrit + POSTGRES_DB: *db-name + POSTGRES_USER: *db-user + POSTGRES_PASSWORD: *db-password commands: - pip install uv - uv sync --group ci - - ./.venv/bin/coverage run ./src/manage.py test newsreader - - ./.venv/bin/coverage report --show-missing + - uv run --no-sync -- coverage run ./src/manage.py test newsreader + - uv run --no-sync -- coverage report --show-missing - name: javascript tests - image: node:lts + image: node:lts-alpine commands: - - npm install + - npm ci - npm test