Skip to content

Commit

Permalink
Attempt to use an env var (may not work)
Browse files Browse the repository at this point in the history
  • Loading branch information
VersusFacit committed Mar 22, 2024
1 parent 48ff055 commit a1a5ad2
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/internal-archive-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -86,26 +87,26 @@ 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
python -m pip --version
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

####################
Expand 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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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

###################
Expand Down

0 comments on commit a1a5ad2

Please sign in to comment.