Remove a line from ex. (#16) #129
This file contains 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 and test pgcachewatch | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
ci: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
postgres-version: ["14", "15", "16"] | |
os: [ubuntu-latest] | |
name: PY ${{ matrix.python-version }} on ${{ matrix.os }} using PG ${{ matrix.postgres-version }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build custom PostgreSQL Docker image | |
run: | | |
docker build \ | |
--build-arg POSTGRES_VERSION=${{ matrix.postgres-version }} \ | |
-t custom-postgres:latest tests/db/ | |
env: | |
POSTGRES_VERSION: ${{ matrix.postgres-version }} | |
- name: Start PostgreSQL container | |
run: | | |
docker run -d --network host --name postgres custom-postgres:latest | |
- name: Install pgcachewatch | |
run: | | |
pip install pip -U | |
pip install .[dev] | |
- name: Wait for PostgreSQL to become ready | |
run: | | |
for i in {1..10}; do | |
docker exec postgres pg_isready && break | |
sleep 5 | |
done | |
- name: Check PostgreSQL Container Logs | |
run: docker logs postgres | |
- name: Full test | |
run: pytest -v | |
check: | |
name: Check test matrix passed. | |
needs: ci | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check status | |
run: echo "All tests passed; ready to merge." |