Merge pull request #2184 from lexicalunit/dependabot/uv/cachetools-7.0.0 #6034
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: build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - "docs/**" | |
| - CHANGELOG.md | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - "docs/**" | |
| - CHANGELOG.md | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ["3.13"] | |
| postgres-version: ["15"] | |
| database-url: | |
| ["postgresql+psycopg://postgres:postgres@localhost:5432/postgres"] | |
| services: | |
| postgres: | |
| image: postgres:${{ matrix.postgres-version }} | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| --name postgres | |
| ports: | |
| - 5432:5432 | |
| env: | |
| PGHOST: localhost | |
| PGUSER: postgres | |
| PGDATABASE: postgres | |
| PGPASSWORD: postgres | |
| steps: | |
| - name: Install postgresql-client | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --yes postgresql-client | |
| - name: Connect to PostgreSQL with CLI | |
| run: psql -c 'SELECT VERSION();' | |
| - name: Show PostgreSQL config file | |
| run: psql -c 'SHOW config_file;' | |
| - name: Alter max connections | |
| run: | | |
| docker exec -i postgres bash << EOF | |
| sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf | |
| sed -i -e 's/shared_buffers = 128MB/shared_buffers = 2GB/' /var/lib/postgresql/data/postgresql.conf | |
| EOF | |
| docker restart --time 0 postgres | |
| sleep 5 | |
| - name: Show max connections | |
| run: psql -c 'SHOW max_connections;' | |
| - name: Checkout Source | |
| uses: actions/checkout@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: latest | |
| enable-cache: true | |
| - name: Install Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Run Tests | |
| run: uv run --frozen pytest -n auto -vv --cov --cov-report=html --cov-report=xml | |
| env: | |
| DATABASE_URL: ${{ matrix.database-url }} | |
| - name: Send Reports to Codecov | |
| uses: codecov/codecov-action@v4 | |
| env: | |
| PYTHON: ${{ matrix.python-version }} | |
| POSTGRES: ${{ matrix.postgres-version }} | |
| DB_URL: ${{ matrix.database-url }} | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| env_vars: PYTHON,POSTGRES,DB_URL | |
| deploy-stage: | |
| name: Deploy to stage | |
| needs: build | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| uses: ./.github/workflows/deploy.yml | |
| with: | |
| environment: stage | |
| secrets: inherit |