Skip to content

Commit a1a5ad2

Browse files
committed
Attempt to use an env var (may not work)
1 parent 48ff055 commit a1a5ad2

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

Diff for: .github/workflows/internal-archive-release.yml

+13-12
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ defaults:
3232
shell: bash
3333

3434
env:
35-
PYTHON_TARGET_VERSION: 3.11
35+
PYTHON_TARGET_VERSION: 3.8
3636
NOTIFICATION_PREFIX: "[Internal Archive Release]"
3737
TEMP_PROFILE_NAME: "temp_aws_profile"
38+
USE_HATCH: "${{ contains(fromJSON( '["postgres"]' ), inputs.dbms_name) }}"
3839

3940
jobs:
4041
job-setup:
@@ -86,26 +87,26 @@ jobs:
8687
# Testing with Tox
8788
#
8889
- name: "Install Python Dependencies"
89-
if: contains(fromJSON( '["redshift", "snowflake", "bigquery"]' ), inputs.dbms_name)
90+
if: ! "${{ env.USE_HATCH }}"
9091
run: |
9192
python -m pip install --user --upgrade pip
9293
python -m pip install tox
9394
python -m pip --version
9495
python -m tox --version
9596
9697
- name: "Run Tests using tox"
97-
if: contains(fromJSON( '["redshift", "snowflake", "bigquery"]' ), inputs.dbms_name)
98+
if: ! "${{ env.USE_HATCH }}"
9899
run: tox
99100

100101
#
101102
# Testing with Hatch
102103
#
103104
- name: "Setup `hatch`"
104-
if: contains(fromJSON('["postgres"]'), inputs.dbms_name)
105+
if: "${{ env.USE_HATCH }}"
105106
uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main
106107

107108
- name: "Run Tests using hatch"
108-
if: contains(fromJSON('["postgres"]'), inputs.dbms_name)
109+
if: "${{ env.USE_HATCH }}"
109110
run: hatch run unit-tests:all
110111

111112
####################
@@ -116,7 +117,7 @@ jobs:
116117
name: 'Integration Tests (Tox)'
117118
runs-on: ubuntu-latest
118119
needs: [job-setup]
119-
if: contains(fromJSON( '["redshift", "snowflake", "bigquery"]' ), inputs.dbms_name)
120+
if: ! "${{ env.USE_HATCH }}"
120121

121122
env:
122123
TOXENV: integration
@@ -179,7 +180,7 @@ jobs:
179180
run-integration-tests-hatch:
180181
name: 'Integration Tests (Hatch)'
181182
needs: [job-setup]
182-
if: contains(fromJSON('["postgres"]'), inputs.dbms_name)
183+
if: ! "${{ env.USE_HATCH }}"
183184

184185
uses: "dbt-labs/dbt-postgres/.github/workflows/integration-tests.yml@main"
185186
with:
@@ -253,13 +254,13 @@ jobs:
253254
v="${base}${new_number}"
254255
tee <<< "version = \"${v}\"" "${version_file}"
255256
if [ -f "${setup_file}" ]; then
256-
sed -i "s/^package_version = \".*\"/package_version = \"${v}\"/" "${setup_file}"
257+
sed -i "s/^package_version = .*$/package_version = \"${v}\"/" "${setup_file}"
257258
fi
258259
else
259260
v="${version_in_file}+build1"
260261
tee <<< "version = \"${v}\"" "${version_file}"
261262
if [ -f "${setup_file}" ]; then
262-
sed -i "s/^package_version = \".*\"/package_version = \"${v}\"/" "${setup_file}"
263+
sed -i "s/^package_version = .*$/package_version = \"${v}\"/" "${setup_file}"
263264
fi
264265
fi
265266
@@ -271,18 +272,18 @@ jobs:
271272
# 1. Build with setup.py
272273
#
273274
- name: "Build Distributions - scripts/build-dist.sh"
274-
if: contains(fromJSON( '["redshift", "snowflake", "bigquery", "spark"]' ), inputs.dbms_name)
275+
if: ! "${{ env.USE_HATCH }}"
275276
run: scripts/build-dist.sh
276277

277278
#
278279
# 2. Build with Hatch
279280
#
280281
- name: "Setup `hatch`"
281-
if: contains(fromJSON('["postgres"]'), inputs.dbms_name)
282+
if: "${{ env.USE_HATCH }}"
282283
uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main
283284

284285
- name: "Build Distributions - hatch"
285-
if: contains(fromJSON('["postgres"]'), inputs.dbms_name)
286+
if: "${{ env.USE_HATCH }}"
286287
run: hatch build
287288

288289
###################

0 commit comments

Comments
 (0)