-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
61 additions
and
82 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,6 @@ jobs: | |
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
|
@@ -57,7 +56,6 @@ jobs: | |
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Get latest release | ||
uses: rez0n/actions-github-release@main | ||
|
@@ -66,48 +64,39 @@ jobs: | |
token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: ${{ github.repository }} | ||
type: "stable" | ||
|
||
- name: Checkout latest release | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ steps.latest_release.outputs.release }} | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8.x" | ||
architecture: "x64" | ||
|
||
- name: Install tox | ||
run: python3 -m pip install tox | ||
|
||
- id: auth-on-release | ||
if: ${{ matrix.warehouse == 'bigquery' }} | ||
uses: google-github-actions/auth@v1 | ||
with: | ||
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | ||
|
||
- name: Build tables for latest release | ||
env: | ||
DBT_VERSION: "noversion" | ||
run: tox -e integration_${{ matrix.warehouse }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR | ||
|
||
# Need to get the auth file again | ||
- id: auth-on-pr | ||
if: ${{ matrix.warehouse == 'bigquery' }} | ||
uses: google-github-actions/auth@v1 | ||
with: | ||
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | ||
|
||
- name: Run Tests on PR | ||
run: tox -e integration_${{ matrix.warehouse }}_${{ env.LAST_RELEASE_SUPPORTED_DBT_VERSION }} | ||
|
||
single-run-different-versions: | ||
needs: integration | ||
strategy: | ||
|
@@ -122,7 +111,6 @@ jobs: | |
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
|
@@ -135,60 +123,48 @@ jobs: | |
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8.x" | ||
architecture: "x64" | ||
|
||
- name: Install tox | ||
run: python3 -m pip install tox | ||
|
||
- name: Install SQL Server | ||
run: docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=123" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest | ||
|
||
- name: Install Microsoft ODBC | ||
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR | ||
|
||
# Need to get the auth file again | ||
- id: auth-on-pr | ||
if: ${{ matrix.warehouse == 'bigquery' }} | ||
uses: google-github-actions/auth@v1 | ||
with: | ||
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | ||
|
||
- name: Run Tests on PR | ||
env: | ||
DBT_VERSION: ${{ matrix.version }} | ||
run: tox -e integration_${{ matrix.warehouse }}_${{ matrix.version }} | ||
|
||
# Databricks doesn't like the matrix strategy, so moving back to the old integration testing without versioning | ||
# integration-databricks: | ||
# runs-on: ubuntu-latest | ||
# environment: | ||
# name: Approve Integration Tests | ||
|
||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR | ||
|
||
# - uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: '3.8.x' | ||
# architecture: 'x64' | ||
|
||
# - name: Install tox | ||
# run: python3 -m pip install tox | ||
|
||
# - name: Run Databricks Tests | ||
# env: | ||
# DBT_VERSION: '' | ||
|
@@ -202,36 +178,36 @@ jobs: | |
name: Approve Integration Tests | ||
|
||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8.x" | ||
architecture: "x64" | ||
- name: Install SQL Server | ||
uses: Particular/[email protected] | ||
with: | ||
connection-string-env-var: SQL_SERVER_CONNECTION_STRING | ||
catalog: dbt_artifact_integrationtests | ||
- name: Create DBT User | ||
shell: pwsh | ||
run: | | ||
echo "Create dbt login with sysadmin" | ||
sqlcmd -Q "CREATE LOGIN dbt WITH PASSWORD = '123', CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF" -d "dbt_artifact_integrationtests" | ||
sqlcmd -Q "ALTER SERVER ROLE sysadmin ADD MEMBER dbt" -d "dbt_artifact_integrationtests" | ||
- name: Install tox | ||
run: python3 -m pip install tox | ||
|
||
- name: Install Microsoft ODBC | ||
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR | ||
|
||
- name: Run Tests on PR | ||
env: | ||
DBT_VERSION: ${{ matrix.version }} | ||
run: tox -e integration_sqlserver | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8.x" | ||
architecture: "x64" | ||
- name: Install SQL Server | ||
uses: Particular/[email protected] | ||
with: | ||
connection-string-env-var: SQL_SERVER_CONNECTION_STRING | ||
catalog: dbt_artifact_integrationtests | ||
- name: Create DBT User | ||
shell: pwsh | ||
run: | | ||
echo "Create dbt login with sysadmin" | ||
sqlcmd -Q "CREATE LOGIN dbt WITH PASSWORD = '123', CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF" -d "dbt_artifact_integrationtests" | ||
sqlcmd -Q "ALTER SERVER ROLE sysadmin ADD MEMBER dbt" -d "dbt_artifact_integrationtests" | ||
- name: Install tox | ||
run: python3 -m pip install tox | ||
|
||
- name: Install Microsoft ODBC | ||
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR | ||
|
||
- name: Run Tests on PR | ||
env: | ||
DBT_VERSION: ${{ matrix.version }} | ||
run: tox -e integration_sqlserver | ||
|
||
integration-sqlserver-single-run: | ||
strategy: | ||
|
@@ -244,31 +220,34 @@ jobs: | |
environment: | ||
name: Approve Integration Tests | ||
|
||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8.x" | ||
architecture: "x64" | ||
- name: Install SQL Server | ||
uses: Particular/[email protected] | ||
with: | ||
connection-string-env-var: SQL_SERVER_CONNECTION_STRING | ||
catalog: dbt_artifact_integrationtests | ||
- name: Create DBT User | ||
shell: pwsh | ||
run: | | ||
echo "Create dbt login with sysadmin" | ||
sqlcmd -Q "CREATE LOGIN dbt WITH PASSWORD = '123', CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF" -d "dbt_artifact_integrationtests" | ||
sqlcmd -Q "ALTER SERVER ROLE sysadmin ADD MEMBER dbt" -d "dbt_artifact_integrationtests" | ||
- name: Install tox | ||
run: python3 -m pip install tox | ||
- name: Install Microsoft ODBC | ||
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR | ||
- name: Run Tests on PR | ||
env: | ||
DBT_VERSION: ${{ matrix.version }} | ||
run: tox -e integration_sqlserver_${{ matrix.version }} | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8.x" | ||
architecture: "x64" | ||
- name: Install SQL Server | ||
uses: Particular/[email protected] | ||
with: | ||
connection-string-env-var: SQL_SERVER_CONNECTION_STRING | ||
catalog: dbt_artifact_integrationtests | ||
- name: Create DBT User | ||
shell: pwsh | ||
run: | | ||
echo "Create dbt login with sysadmin" | ||
sqlcmd -Q "CREATE LOGIN dbt WITH PASSWORD = '123', CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF" -d "dbt_artifact_integrationtests" | ||
sqlcmd -Q "ALTER SERVER ROLE sysadmin ADD MEMBER dbt" -d "dbt_artifact_integrationtests" | ||
- name: Install tox | ||
run: python3 -m pip install tox | ||
|
||
- name: Install Microsoft ODBC | ||
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR | ||
|
||
- name: Run Tests on PR | ||
env: | ||
DBT_VERSION: ${{ matrix.version }} | ||
run: tox -e integration_sqlserver_${{ matrix.version }} |