mirror of
https://github.com/dbt-labs/dbt-core
synced 2025-12-20 02:11:27 +00:00
Compare commits
1 Commits
bump-postg
...
postgres-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9f893a291 |
11
.github/actions/setup-postgres-linux/action.yml
vendored
11
.github/actions/setup-postgres-linux/action.yml
vendored
@@ -5,15 +5,6 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get --purge remove postgresql postgresql-*
|
sudo systemctl start postgresql.service
|
||||||
sudo apt update -y
|
|
||||||
sudo apt install gnupg2 wget vim -y
|
|
||||||
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
|
|
||||||
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
|
|
||||||
sudo apt update -y
|
|
||||||
sudo apt install postgresql-16
|
|
||||||
sudo apt-get -y install postgresql postgresql-contrib
|
|
||||||
sudo systemctl start postgresql
|
|
||||||
sudo systemctl enable postgresql
|
|
||||||
pg_isready
|
pg_isready
|
||||||
sudo -u postgres bash ${{ github.action_path }}/setup_db.sh
|
sudo -u postgres bash ${{ github.action_path }}/setup_db.sh
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
brew install postgresql@16
|
brew services start postgresql
|
||||||
brew services start postgresql@16
|
|
||||||
echo "Check PostgreSQL service is running"
|
echo "Check PostgreSQL service is running"
|
||||||
i=10
|
i=10
|
||||||
COMMAND='pg_isready'
|
COMMAND='pg_isready'
|
||||||
|
|||||||
@@ -5,37 +5,6 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- shell: pwsh
|
- shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
# Download postgres16
|
|
||||||
$url = "https://get.enterprisedb.com/postgresql/postgresql-16.1-1-windows-x64.exe"
|
|
||||||
$checkAccess = [System.Net.WebRequest]::Create($url)
|
|
||||||
$response = $checkAccess.GetResponse()
|
|
||||||
$installerUrl = $response.ResponseUri.OriginalString
|
|
||||||
|
|
||||||
# Invoke Install-Binary function
|
|
||||||
$installerArgs = @("--install_runtimes 0", "--superpassword root", "--enable_acledit 1", "--unattendedmodeui none", "--mode unattended")
|
|
||||||
Install-Binary `
|
|
||||||
-Url $url `
|
|
||||||
-InstallArgs $installerArgs `
|
|
||||||
-ExpectedSignature (Get-ToolsetContent).postgresql.signature
|
|
||||||
|
|
||||||
# Get Path to pg_ctl.exe
|
|
||||||
$pgPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName
|
|
||||||
|
|
||||||
# Parse output of command above to obtain pure path
|
|
||||||
$pgBin = Split-Path -Path $pgPath.split('"')[1]
|
|
||||||
$pgRoot = Split-Path -Path $pgPath.split('"')[5]
|
|
||||||
$pgData = Join-Path $pgRoot "data"
|
|
||||||
|
|
||||||
# Validate PostgreSQL installation
|
|
||||||
$pgReadyPath = Join-Path $pgBin "pg_isready.exe"
|
|
||||||
$pgReady = Start-Process -FilePath $pgReadyPath -Wait -PassThru
|
|
||||||
$exitCode = $pgReady.ExitCode
|
|
||||||
|
|
||||||
if ($exitCode -ne 0) {
|
|
||||||
Write-Host -Object "PostgreSQL is not ready. Exitcode: $exitCode"
|
|
||||||
exit $exitCode
|
|
||||||
}
|
|
||||||
|
|
||||||
$pgService = Get-Service -Name postgresql*
|
$pgService = Get-Service -Name postgresql*
|
||||||
Set-Service -InputObject $pgService -Status running -StartupType automatic
|
Set-Service -InputObject $pgService -Status running -StartupType automatic
|
||||||
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
|
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
|
||||||
|
|||||||
30
.github/workflows/main.yml
vendored
30
.github/workflows/main.yml
vendored
@@ -165,6 +165,18 @@ jobs:
|
|||||||
os: [ubuntu-20.04]
|
os: [ubuntu-20.04]
|
||||||
split-group: ${{ fromJson(needs.integration-metadata.outputs.split-groups) }}
|
split-group: ${{ fromJson(needs.integration-metadata.outputs.split-groups) }}
|
||||||
include: ${{ fromJson(needs.integration-metadata.outputs.include) }}
|
include: ${{ fromJson(needs.integration-metadata.outputs.include) }}
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
env:
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
options: >-
|
||||||
|
--health-cmd pg_isready
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
env:
|
env:
|
||||||
TOXENV: integration
|
TOXENV: integration
|
||||||
DBT_INVOCATION_ENV: github-actions
|
DBT_INVOCATION_ENV: github-actions
|
||||||
@@ -189,14 +201,32 @@ jobs:
|
|||||||
- name: Set up postgres (linux)
|
- name: Set up postgres (linux)
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
uses: ./.github/actions/setup-postgres-linux
|
uses: ./.github/actions/setup-postgres-linux
|
||||||
|
env:
|
||||||
|
PGHOST: localhost
|
||||||
|
PGPORT: 5432
|
||||||
|
PGUSER: postgres
|
||||||
|
PGPASSWORD: postgres
|
||||||
|
PGDATABASE: postgres
|
||||||
|
|
||||||
- name: Set up postgres (macos)
|
- name: Set up postgres (macos)
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
uses: ./.github/actions/setup-postgres-macos
|
uses: ./.github/actions/setup-postgres-macos
|
||||||
|
env:
|
||||||
|
PGHOST: localhost
|
||||||
|
PGPORT: 5432
|
||||||
|
PGUSER: postgres
|
||||||
|
PGPASSWORD: postgres
|
||||||
|
PGDATABASE: postgres
|
||||||
|
|
||||||
- name: Set up postgres (windows)
|
- name: Set up postgres (windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
uses: ./.github/actions/setup-postgres-windows
|
uses: ./.github/actions/setup-postgres-windows
|
||||||
|
env:
|
||||||
|
PGHOST: localhost
|
||||||
|
PGPORT: 5432
|
||||||
|
PGUSER: postgres
|
||||||
|
PGPASSWORD: postgres
|
||||||
|
PGDATABASE: postgres
|
||||||
|
|
||||||
- name: Install python tools
|
- name: Install python tools
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ for i in {1..10}; do
|
|||||||
done;
|
done;
|
||||||
|
|
||||||
createdb dbt
|
createdb dbt
|
||||||
psql -c "SELECT version();"
|
|
||||||
psql -c "CREATE ROLE root WITH PASSWORD 'password';"
|
psql -c "CREATE ROLE root WITH PASSWORD 'password';"
|
||||||
psql -c "ALTER ROLE root WITH LOGIN;"
|
psql -c "ALTER ROLE root WITH LOGIN;"
|
||||||
psql -c "GRANT CREATE, CONNECT ON DATABASE dbt TO root WITH GRANT OPTION;"
|
psql -c "GRANT CREATE, CONNECT ON DATABASE dbt TO root WITH GRANT OPTION;"
|
||||||
|
|||||||
Reference in New Issue
Block a user