[pre-commit.ci] pre-commit autoupdate (#171) #390
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10000 # Very high timeout for label name testing | |
| name: Python ${{ matrix.python-version }} sample with Postgres ${{ matrix.postgres-version }} | |
| strategy: | |
| matrix: | |
| python-version: [ | |
| '3.10', | |
| '3.11', | |
| '3.12', | |
| '3.13', | |
| '3.14', | |
| "3.15-dev", | |
| 'pypy-3.10', | |
| 'pypy-3.11', | |
| ] | |
| postgres-version: ['14', '15', '16', '17',"18"] | |
| continue-on-error: true | |
| 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 --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 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Run tests | |
| run: | | |
| uv run pytest -v -x tests/ | |
| # - name: Upload pytest test results | |
| # uses: actions/upload-artifact@v2 | |
| # with: | |
| # name: pytest-results-${{ matrix.python-version }} | |
| # path: junit/test-results-${{ matrix.python-version }}.xml | |
| # if: ${{ always() }} | |
| merge: | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| # Only run if the PR author is Dependabot or pre-commit-ci | |
| if: github.actor == 'dependabot[bot]' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Enable auto-merge for Dependabot PRs | |
| run: gh pr merge --auto --merge "$PR_URL" # Use Github CLI to merge automatically the PR | |
| 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] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/django-ltree-2 | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Build package | |
| run: | | |
| uv run hatch build | |
| - name: Upload release assets | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: dist/* | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| file_glob: true | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ |