From a1a5ad2eab0f7ca95703c6604cf99e9938d49e3c Mon Sep 17 00:00:00 2001 From: Mila Page Date: Fri, 22 Mar 2024 13:37:42 -0700 Subject: [PATCH] Attempt to use an env var (may not work) --- .../workflows/internal-archive-release.yml | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/internal-archive-release.yml b/.github/workflows/internal-archive-release.yml index 0a701c8..859321b 100644 --- a/.github/workflows/internal-archive-release.yml +++ b/.github/workflows/internal-archive-release.yml @@ -32,9 +32,10 @@ defaults: shell: bash env: - PYTHON_TARGET_VERSION: 3.11 + PYTHON_TARGET_VERSION: 3.8 NOTIFICATION_PREFIX: "[Internal Archive Release]" TEMP_PROFILE_NAME: "temp_aws_profile" + USE_HATCH: "${{ contains(fromJSON( '["postgres"]' ), inputs.dbms_name) }}" jobs: job-setup: @@ -86,7 +87,7 @@ jobs: # Testing with Tox # - name: "Install Python Dependencies" - if: contains(fromJSON( '["redshift", "snowflake", "bigquery"]' ), inputs.dbms_name) + if: ! "${{ env.USE_HATCH }}" run: | python -m pip install --user --upgrade pip python -m pip install tox @@ -94,18 +95,18 @@ jobs: python -m tox --version - name: "Run Tests using tox" - if: contains(fromJSON( '["redshift", "snowflake", "bigquery"]' ), inputs.dbms_name) + if: ! "${{ env.USE_HATCH }}" run: tox # # Testing with Hatch # - name: "Setup `hatch`" - if: contains(fromJSON('["postgres"]'), inputs.dbms_name) + if: "${{ env.USE_HATCH }}" uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main - name: "Run Tests using hatch" - if: contains(fromJSON('["postgres"]'), inputs.dbms_name) + if: "${{ env.USE_HATCH }}" run: hatch run unit-tests:all #################### @@ -116,7 +117,7 @@ jobs: name: 'Integration Tests (Tox)' runs-on: ubuntu-latest needs: [job-setup] - if: contains(fromJSON( '["redshift", "snowflake", "bigquery"]' ), inputs.dbms_name) + if: ! "${{ env.USE_HATCH }}" env: TOXENV: integration @@ -179,7 +180,7 @@ jobs: run-integration-tests-hatch: name: 'Integration Tests (Hatch)' needs: [job-setup] - if: contains(fromJSON('["postgres"]'), inputs.dbms_name) + if: ! "${{ env.USE_HATCH }}" uses: "dbt-labs/dbt-postgres/.github/workflows/integration-tests.yml@main" with: @@ -253,13 +254,13 @@ jobs: v="${base}${new_number}" tee <<< "version = \"${v}\"" "${version_file}" if [ -f "${setup_file}" ]; then - sed -i "s/^package_version = \".*\"/package_version = \"${v}\"/" "${setup_file}" + sed -i "s/^package_version = .*$/package_version = \"${v}\"/" "${setup_file}" fi else v="${version_in_file}+build1" tee <<< "version = \"${v}\"" "${version_file}" if [ -f "${setup_file}" ]; then - sed -i "s/^package_version = \".*\"/package_version = \"${v}\"/" "${setup_file}" + sed -i "s/^package_version = .*$/package_version = \"${v}\"/" "${setup_file}" fi fi @@ -271,18 +272,18 @@ jobs: # 1. Build with setup.py # - name: "Build Distributions - scripts/build-dist.sh" - if: contains(fromJSON( '["redshift", "snowflake", "bigquery", "spark"]' ), inputs.dbms_name) + if: ! "${{ env.USE_HATCH }}" run: scripts/build-dist.sh # # 2. Build with Hatch # - name: "Setup `hatch`" - if: contains(fromJSON('["postgres"]'), inputs.dbms_name) + if: "${{ env.USE_HATCH }}" uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main - name: "Build Distributions - hatch" - if: contains(fromJSON('["postgres"]'), inputs.dbms_name) + if: "${{ env.USE_HATCH }}" run: hatch build ###################