From 4434a6524c2568906e81308a22775de3c0506b8a Mon Sep 17 00:00:00 2001 From: Michelle Yan Date: Tue, 5 Nov 2024 09:25:17 -0800 Subject: [PATCH] reverting to #450 --- .github/workflows/ci_test_package.yml | 143 +++++++++++--------------- 1 file changed, 61 insertions(+), 82 deletions(-) diff --git a/.github/workflows/ci_test_package.yml b/.github/workflows/ci_test_package.yml index dcc32ee1..9e61fddb 100644 --- a/.github/workflows/ci_test_package.yml +++ b/.github/workflows/ci_test_package.yml @@ -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,37 +64,30 @@ 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' }} @@ -104,10 +95,8 @@ jobs: 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,27 +123,21 @@ 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' }} @@ -163,32 +145,26 @@ jobs: 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/install-sql-server-action@v1.2.0 - 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/install-sql-server-action@v1.2.0 + 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/install-sql-server-action@v1.2.0 - 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/install-sql-server-action@v1.2.0 + 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 }}