Skip to content

[pre-commit.ci] pre-commit autoupdate #1025

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #1025

Workflow file for this run

name: CI
on: [push]
permissions:
contents: write
pull-requests: write
jobs:
build-frontend:
name: Build Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v7
with:
name: workspace
path: .
test-frontend:
name: Test Frontend
needs: build-frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: workspace
path: .
- uses: actions/setup-node@v6
with:
node-version: 24
- run: npm ci
- run: npm run test
test-backend:
name: Test Backend
needs: build-frontend
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', 'pypy-3.10', 'pypy-3.11']
postgres-version: ['14', '15', '16', '17', '18']
services:
database:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
selenium:
image: selenium/standalone-chrome:latest
ports:
- 4444:4444
options: >-
--health-cmd="curl -s http://localhost:4444/wd/hub/status | grep \"\"ready\"\""
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
DJANGO_DATABASE_HOST: localhost
DJANGO_DATABASE_USER: postgres
DJANGO_DATABASE_PASSWORD: postgres
DJANGO_DATABASE_NAME: postgres
SELENIUM_REMOTE_URL: http://localhost:4444/wd/hub
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: workspace
path: .
- name: Set up Python (uv)
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
cache-dependency-glob: 'uv.lock'
- name: Create virtual environment and install dependencies
run: |
uv sync --group test --group build
- name: Run backend tests
run: uv run pytest -v -x -rs
merge:
name: Auto-merge Dependabot
runs-on: ubuntu-latest
needs: [test-frontend, test-backend]
if: github.actor == 'dependabot[bot]'
steps:
- uses: actions/checkout@v6
- name: Enable auto-merge
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Publish Release
if: startsWith(github.ref, 'refs/tags/')
needs: [test-frontend, test-backend]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/django-hstore-widget
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v6
- name: Install Hatch
run: pip install hatch
- uses: actions/download-artifact@v8
with:
name: workspace
path: .
- name: Build package
run: |
hatch build
- name: Upload release assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: py-dist/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: py-dist/