Skip to content

Commit

Permalink
reverting to #450
Browse files Browse the repository at this point in the history
  • Loading branch information
michlyan committed Nov 5, 2024
1 parent 8aeaa10 commit 4434a65
Showing 1 changed file with 61 additions and 82 deletions.
143 changes: 61 additions & 82 deletions .github/workflows/ci_test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
permissions:
contents: "read"
id-token: "write"

services:
postgres:
image: postgres
Expand All @@ -57,7 +56,6 @@ jobs:
--health-retries 5
ports:
- 5432:5432

steps:
- name: Get latest release
uses: rez0n/actions-github-release@main
Expand All @@ -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:
Expand All @@ -122,7 +111,6 @@ jobs:
permissions:
contents: "read"
id-token: "write"

services:
postgres:
image: postgres
Expand All @@ -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: ''
Expand All @@ -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:
Expand All @@ -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 }}

0 comments on commit 4434a65

Please sign in to comment.