CI: test with postgres 15 (#2149)
Postgres 15 restricts the default privileges for the public schema. We set crowdsec_test as owner which is shorter than granting permissions explicitly.
This commit is contained in:
parent
46fff0b544
commit
202112bcae
2 changed files with 10 additions and 3 deletions
10
.github/workflows/bats-postgres.yml
vendored
10
.github/workflows/bats-postgres.yml
vendored
|
@ -17,7 +17,7 @@ jobs:
|
|||
timeout-minutes: 30
|
||||
services:
|
||||
database:
|
||||
image: postgres:14
|
||||
image: postgres:15
|
||||
env:
|
||||
POSTGRES_PASSWORD: "secret"
|
||||
ports:
|
||||
|
@ -30,6 +30,14 @@ jobs:
|
|||
|
||||
steps:
|
||||
|
||||
- name: "Install pg_dump v15"
|
||||
# we can remove this when it's released on ubuntu-latest
|
||||
run: |
|
||||
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 -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null
|
||||
sudo apt update
|
||||
sudo apt -qq -y -o=Dpkg::Use-Pty=0 install postgresql-client-15
|
||||
|
||||
- name: "Force machineid"
|
||||
run: |
|
||||
sudo chmod +w /etc/machine-id
|
||||
|
|
|
@ -42,10 +42,9 @@ exec_sql() {
|
|||
|
||||
setup() {
|
||||
exec_sql "DROP DATABASE IF EXISTS crowdsec_test;"
|
||||
exec_sql "CREATE DATABASE crowdsec_test;"
|
||||
exec_sql "DROP USER IF EXISTS crowdsec_test;"
|
||||
exec_sql "CREATE USER crowdsec_test WITH ENCRYPTED PASSWORD 'crowdsec_test';"
|
||||
exec_sql "GRANT ALL PRIVILEGES ON DATABASE crowdsec_test TO crowdsec_test;"
|
||||
exec_sql "CREATE DATABASE crowdsec_test OWNER crowdsec_test;"
|
||||
}
|
||||
|
||||
dump() {
|
||||
|
|
Loading…
Reference in a new issue