.github: start compare workflow #78
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
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| # Smoke test some os/arch combinations | |
| os: | |
| - ubuntu-22.04 | |
| - macOS-13 | |
| - macOS-14-xlarge # arm64 | |
| - macOS-14 | |
| - macOS-15 | |
| - windows-2019 | |
| - windows-2022 | |
| - windows-2025 | |
| # Smoke test some postgres versions | |
| version: | |
| - 17.2.0 | |
| - 16.4.0 | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Test action.yml | |
| id: postgres | |
| uses: ./ | |
| - name: test | |
| env: | |
| DSN: ${{ steps.postgres.outputs.dsn }} | |
| run: | | |
| set -ueo pipefail | |
| set -x | |
| got=$(postgres --version) | |
| want="postgres (PostgreSQL) 17.2" | |
| if [ "$got" != "$want" ]; then | |
| echo "unexpected postgres version: got $got, want $want" | |
| exit 1 | |
| fi | |
| if [ -z "$DATABASE_URL" ]; then | |
| echo "DATABASE_URL is not set" | |
| exit 1 | |
| fi | |
| # Check these vars are set | |
| vars="PGHOST PGPORT PGUSER PGPASSWORD PGDATABASE PGSSLMODE" | |
| for v in $vars; do | |
| if [ -z "${!v}" ]; then | |
| echo "expected $v to be set" | |
| exit 1 | |
| fi | |
| done | |
| if [ "$DATABASE_URL" = "$DSN" ]; then | |
| echo "postgres.url = $DATABASE_URL; want = $OUT_DATABASE_URL" | |
| exit 1 | |
| fi | |
| # Check the database is up | |
| psql -c 'SELECT 1' "$DATABASE_URL" |