3.4.1 #453
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: test | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Node v${{ matrix.node }} on PostgreSQL v${{ matrix.postgres }} | |
strategy: | |
fail-fast: false | |
matrix: | |
node: ['12', '14', '16', '18', '20'] | |
postgres: ['12', '13', '14', '15', '16'] | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:${{ matrix.postgres }} | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5433:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
date | |
sudo apt purge postgresql-14 | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get -y install "postgresql-${{ matrix.postgres }}" | |
sudo cp ./tests/pg_hba.conf /etc/postgresql/${{ matrix.postgres }}/main/pg_hba.conf | |
sudo sed -i 's/.*wal_level.*/wal_level = logical/' /etc/postgresql/${{ matrix.postgres }}/main/postgresql.conf | |
sudo sed -i 's/.*max_prepared_transactions.*/max_prepared_transactions = 100/' /etc/postgresql/${{ matrix.postgres }}/main/postgresql.conf | |
sudo sed -i 's/.*ssl = .*/ssl = on/' /etc/postgresql/${{ matrix.postgres }}/main/postgresql.conf | |
openssl req -new -x509 -nodes -days 365 -text -subj "/CN=localhost" -extensions v3_req -config <(cat /etc/ssl/openssl.cnf <(printf "\n[v3_req]\nbasicConstraints=critical,CA:TRUE\nkeyUsage=nonRepudiation,digitalSignature,keyEncipherment\nsubjectAltName=DNS:localhost")) -keyout server.key -out server.crt | |
sudo cp server.key /etc/postgresql/${{ matrix.postgres }}/main/server.key | |
sudo cp server.crt /etc/postgresql/${{ matrix.postgres }}/main/server.crt | |
sudo chmod og-rwx /etc/postgresql/${{ matrix.postgres }}/main/server.key | |
sudo systemctl start postgresql.service | |
sudo systemctl status postgresql.service | |
pg_isready | |
sudo -u postgres psql -c "SHOW hba_file;" | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- run: npm test | |
env: | |
PGUSER: postgres | |
PGSOCKET: /var/run/postgresql |