mirror of
https://github.com/dbt-labs/dbt-core
synced 2025-12-19 23:21:28 +00:00
Compare commits
5 Commits
github-act
...
leahwicz-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc49828618 | ||
|
|
611465b20c | ||
|
|
8f4777db5a | ||
|
|
06d87c0fe4 | ||
|
|
00c0780b56 |
82
.github/workflows/tests.yml
vendored
82
.github/workflows/tests.yml
vendored
@@ -40,13 +40,14 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||||
|
python-version: ['3.6', '3.7', '3.8']
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v2.2.2
|
uses: actions/setup-python@v2.2.2
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- name: 'Install dependencies'
|
- name: 'Install dependencies'
|
||||||
@@ -55,8 +56,17 @@ jobs:
|
|||||||
- name: 'Run unit tests'
|
- name: 'Run unit tests'
|
||||||
run: python -m tox -e py -- -v
|
run: python -m tox -e py -- -v
|
||||||
|
|
||||||
PostgresIntegrationTest:
|
PostgresIntegrationTest-Windows:
|
||||||
runs-on: 'windows-latest' #TODO: Add Mac support
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- python-version: '3.6'
|
||||||
|
environment-version: 'py36-postgres'
|
||||||
|
- python-version: '3.7'
|
||||||
|
environment-version: 'py37-postgres'
|
||||||
|
- python-version: '3.8'
|
||||||
|
environment-version: 'py38-postgres'
|
||||||
|
runs-on: 'windows-latest'
|
||||||
environment: 'Postgres'
|
environment: 'Postgres'
|
||||||
needs: UnitTest
|
needs: UnitTest
|
||||||
steps:
|
steps:
|
||||||
@@ -81,14 +91,67 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v2.2.2
|
uses: actions/setup-python@v2.2.2
|
||||||
with:
|
with:
|
||||||
python-version: '3.7'
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- name: 'Install dependencies'
|
- name: 'Install dependencies'
|
||||||
run: python -m pip install --upgrade pip && pip install tox
|
run: python -m pip install --upgrade pip && pip install tox
|
||||||
|
|
||||||
- name: 'Run integration tests'
|
- name: 'Run integration tests'
|
||||||
run: python -m tox -e py-postgres -- -v -n4
|
run: python -m tox -e ${{ matrix.environment-version }} -- -v -n4
|
||||||
|
|
||||||
|
PostgresIntegrationTest-Mac:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- python-version: '3.6'
|
||||||
|
environment-version: 'py36-postgres'
|
||||||
|
- python-version: '3.7'
|
||||||
|
environment-version: 'py37-postgres'
|
||||||
|
- python-version: '3.8'
|
||||||
|
environment-version: 'py38-postgres'
|
||||||
|
runs-on: 'macos-latest'
|
||||||
|
environment: 'Postgres'
|
||||||
|
needs: UnitTest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Start PostgreSQL on MacOS
|
||||||
|
run: |
|
||||||
|
brew services start postgresql
|
||||||
|
echo "Check PostgreSQL service is running"
|
||||||
|
i=10
|
||||||
|
COMMAND='pg_isready'
|
||||||
|
while [ $i -gt 0 ]; do
|
||||||
|
echo "Check PostgreSQL service status"
|
||||||
|
eval $COMMAND && break
|
||||||
|
((i--))
|
||||||
|
if [ $i == 0 ]; then
|
||||||
|
echo "PostgreSQL service not ready, all attempts exhausted"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "PostgreSQL service not ready, wait 10 more sec, attempts left: $i"
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
- name: Create users and DBs
|
||||||
|
run: |
|
||||||
|
psql --command="CREATE USER root PASSWORD '$env:ROOT_PASSWORD'" --command="\du" postgres
|
||||||
|
createdb --owner=root dbt
|
||||||
|
PGPASSWORD=$env:ROOT_PASSWORD psql --username=root --host=localhost --list dbt
|
||||||
|
psql --command="CREATE USER noaccess PASSWORD '$env:NOACCESS_PASSWORD'" --command="\du" postgres
|
||||||
|
psql --command="grant all privileges on database dbt to noaccess" --command="\du" postgres
|
||||||
|
createdb --owner=root dbtMixedCase
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v2.2.2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
architecture: 'x64'
|
||||||
|
|
||||||
|
- name: 'Install dependencies'
|
||||||
|
run: python -m pip install --upgrade pip && pip install tox
|
||||||
|
|
||||||
|
- name: 'Run integration tests'
|
||||||
|
run: tox -p -e ${{ matrix.environment-version }} -- -v -n4
|
||||||
|
|
||||||
# These three are all similar except secure environment variables, which MUST be passed along to their tasks,
|
# These three are all similar except secure environment variables, which MUST be passed along to their tasks,
|
||||||
# but there's probably a better way to do this!
|
# but there's probably a better way to do this!
|
||||||
@@ -96,6 +159,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, macos-latest]
|
os: [windows-latest, macos-latest]
|
||||||
|
python-version: ['3.6', '3.7', '3.8']
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
environment: 'Snowflake'
|
environment: 'Snowflake'
|
||||||
needs: UnitTest
|
needs: UnitTest
|
||||||
@@ -104,7 +168,7 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v2.2.2
|
uses: actions/setup-python@v2.2.2
|
||||||
with:
|
with:
|
||||||
python-version: '3.7'
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- name: 'Install dependencies'
|
- name: 'Install dependencies'
|
||||||
@@ -130,6 +194,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, macos-latest]
|
os: [windows-latest, macos-latest]
|
||||||
|
python-version: ['3.6', '3.7', '3.8']
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
environment: 'Bigquery'
|
environment: 'Bigquery'
|
||||||
needs: UnitTest
|
needs: UnitTest
|
||||||
@@ -138,7 +203,7 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v2.2.2
|
uses: actions/setup-python@v2.2.2
|
||||||
with:
|
with:
|
||||||
python-version: '3.7'
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- name: 'Install dependencies'
|
- name: 'Install dependencies'
|
||||||
@@ -154,6 +219,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, macos-latest]
|
os: [windows-latest, macos-latest]
|
||||||
|
python-version: ['3.6', '3.7', '3.8']
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
environment: 'Redshift'
|
environment: 'Redshift'
|
||||||
needs: UnitTest
|
needs: UnitTest
|
||||||
@@ -162,7 +228,7 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v2.2.2
|
uses: actions/setup-python@v2.2.2
|
||||||
with:
|
with:
|
||||||
python-version: '3.7'
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- name: 'Install dependencies'
|
- name: 'Install dependencies'
|
||||||
|
|||||||
Reference in New Issue
Block a user