Skip to content

Commit

Permalink
make PG_VERSION a task env var
Browse files Browse the repository at this point in the history
  • Loading branch information
sabify committed Feb 24, 2024
1 parent 2487396 commit ce9ec21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,20 @@ jobs:
sudo apt-get install gnupg2 -y
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
PG_VER=16
sudo apt-get update
sudo apt-get install -y libpq-dev postgresql-$PG_VER
sudo tee /etc/postgresql/$PG_VER/main/pg_hba.conf <<'EOF'
sudo apt-get install -y libpq-dev postgresql-$PG_VERSION
sudo tee /etc/postgresql/$PG_VERSION/main/pg_hba.conf <<'EOF'
local all postgres peer
local all all peer
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
EOF
sudo service postgresql start $PG_VER && sleep 3
sudo service postgresql start $PG_VERSION && sleep 3
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
sudo service postgresql restart $PG_VER && sleep 3
sudo service postgresql restart $PG_VERSION && sleep 3
echo 'DATABASE_URL=postgres://postgres:postgres@localhost:5432/' >> $GITHUB_ENV
env:
PG_VERSION: 16

- name: Install sqlite (Linux)
if: matrix.backend == 'sqlite'
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/run_benches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ jobs:
sudo apt-get install gnupg2 -y
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
PG_VER=16
sudo apt-get update
sudo apt-get install -y libpq-dev postgresql-$PG_VER
sudo tee /etc/postgresql/$PG_VER/main/pg_hba.conf <<'EOF'
sudo apt-get install -y libpq-dev postgresql-$PG_VERSION
sudo tee /etc/postgresql/$PG_VERSION/main/pg_hba.conf <<'EOF'
local all postgres peer
local all all peer
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
EOF
sudo service postgresql start $PG_VER && sleep 3
sudo service postgresql start $PG_VERSION && sleep 3
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
sudo service postgresql restart $PG_VER && sleep 3
sudo service postgresql restart $PG_VERSION && sleep 3
echo 'DATABASE_URL=postgres://postgres:postgres@localhost:5432/' >> $GITHUB_ENV
env:
PG_VERSION: 16

- name: Install sqlite (Linux)
if: matrix.backend == 'sqlite'
Expand Down

0 comments on commit ce9ec21

Please sign in to comment.