moar #3
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| pg_version: [14, 15, 16, 17, 18] | |
| services: | |
| postgres: | |
| image: postgres:${{ matrix.pg_version }} | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: pg_column_tetris_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U postgres" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| env: | |
| PGHOST: localhost | |
| PGPORT: 5432 | |
| PGUSER: postgres | |
| PGPASSWORD: postgres | |
| PGDATABASE: pg_column_tetris_test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install extension | |
| run: | | |
| # Strip the \echo...\quit guard so we can load the SQL directly | |
| sed '/^\\echo.*\\quit/d' pg_column_tetris--0.1.0.sql | psql -v ON_ERROR_STOP=1 | |
| - name: Run tests | |
| run: | | |
| for f in test/sql/*.sql; do | |
| echo "=== Running $f ===" | |
| psql -v ON_ERROR_STOP=1 -f "$f" | |
| echo "=== $f passed ===" | |
| done |