Skip to content

Commit 09dabfd

Browse files
committed
Cleanup env variables
1 parent 4e055c8 commit 09dabfd

File tree

9 files changed

+47
-87
lines changed

9 files changed

+47
-87
lines changed

.github/actions/build-node-python/action.yml

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,28 @@ inputs:
99
required: true
1010
run_parallel:
1111
description: "enables parallel running of node and python tasks"
12-
default: true
12+
default: "true"
1313
required: true
1414
# Node
1515
enable_node:
1616
description: "enables the node part of the action"
17-
default: true
17+
default: "true"
1818
required: true
1919
node_version:
2020
description: "node version to use"
21-
default: "20.9"
22-
required: true
21+
default: ""
22+
required: false
2323
npm_registry:
2424
description: "npm registry"
25-
default: "https://registry.npmjs.org/"
26-
required: true
25+
required: false
2726
enable_node_cache:
2827
description: "enables the yarn cache download and upload"
2928
required: false
30-
default: true
29+
default: "true"
3130
download_yarn_lock:
3231
description: "downloads the node-yarn-lock artifact (only available when build-node was called before)"
3332
required: false
34-
default: false
33+
default: "false"
3534
upload_yarn_lock:
3635
description: "name of the artifact to upload the node-yarn-lock artifact"
3736
required: false
@@ -41,54 +40,60 @@ inputs:
4140
required: false
4241
default: ''
4342
run_node_lint:
44-
default: true
43+
description: "run node lint"
44+
default: "true"
4545
required: false
4646
run_playwright_browser_install:
47-
default: false
47+
description: "run playwright browser install"
48+
default: "false"
4849
required: false
4950
run_node_test:
50-
default: true
51+
description: "run node test"
52+
default: "true"
5153
required: false
5254
run_node_build:
53-
default: true
55+
description: "run node build"
56+
default: "true"
5457
required: false
5558
run_node_bundle:
56-
default: false
59+
description: "run node bundle"
60+
default: "false"
5761
required: false
5862
chromatic_enable:
5963
description: "Enable Chromatic tests"
6064
required: false
61-
type: boolean
62-
default: false
65+
default: "false"
6366
chromatic_project_token:
6467
description: "Chromatic project token"
6568
required: false
6669
# Python
6770
enable_python:
6871
description: "enables the python part of the action"
69-
default: true
72+
default: "true"
7073
required: true
7174
python_version:
7275
description: "python version to use"
73-
default: "3.10"
74-
required: true
76+
required: false
7577
enable_python_cache:
7678
description: "deprecated and disabled as uv is usually faster anyways"
7779
required: false
78-
default: false
80+
default: "false"
7981
run_python_lint:
80-
default: true
82+
description: "run python lint"
83+
default: "true"
8184
required: false
8285
run_python_test:
83-
default: true
86+
description: "run python test"
87+
default: "true"
8488
required: false
8589
run_python_build:
86-
default: true
90+
description: "run python build"
91+
default: "true"
8792
required: false
8893
# Rust
8994
enable_rust:
9095
description: "enables the rust part of the action"
91-
default: false
96+
default: "false"
9297
required: true
9398

9499
runs:
@@ -103,9 +108,8 @@ runs:
103108
uses: actions/setup-node@v5
104109
if: inputs.enable_node == 'true'
105110
with:
106-
# TODO: Revert the two
107-
node-version: ${{ fromJson(steps.get-node-version.outputs.node_version) || inputs.node_version }}
108-
registry-url: ${{ inputs.npm_registry }}
111+
node-version: ${{ vars.NODE_VERSION || inputs.node_version || fromJson(steps.get-node-version.outputs.node_version) }}
112+
registry-url: ${{ vars.NPM_REGISTRY || inputs.npm_registry || 'https://registry.npmjs.org/' }}
109113
package-manager-cache: false
110114
- name: Show node and npm version
111115
if: inputs.enable_node == 'true'
@@ -119,7 +123,7 @@ runs:
119123
uses: actions/setup-python@v5
120124
if: inputs.enable_python == 'true'
121125
with:
122-
python-version: ${{ inputs.python_version }}
126+
python-version: ${{ vars.PYTHON_VERSION || inputs.python_version || '3.10' }}
123127
# cache: ${{ inputs.enable_python_cache == 'true' && 'pip' || null }} Disable cache as uv is probably faster anyways: https://github.com/actions/setup-python/issues/822
124128
- name: Install additional python requirements
125129
if: inputs.enable_python == 'true'

.github/actions/get-node-version/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ runs:
2828
2929
// Define the versions to check against the package.json engines field, in order of preference
3030
// See https://github.com/actions/node-versions/releases for available versions
31-
const versionsToCheck = ['24.9', '20.9'].map((v) => semver.minVersion(v).version);
31+
const versionsToCheck = ['20.9', '24.9'].map((v) => semver.minVersion(v).version);
3232
3333
const packageJsonPath = path.join(process.env.GITHUB_WORKSPACE, 'package.json');
3434
if (!fs.existsSync(packageJsonPath)) {

.github/actions/publish-python/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
pypi_registry:
77
description: "registry where to publish python package"
88
default: "https://upload.pypi.org/legacy/"
9-
required: true
9+
required: false
1010
pypi_username:
1111
description: "username for python registry"
1212
default: "admin"

.github/workflows/build-node-python.yml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ on:
102102
secrets:
103103
DATAVISYN_BOT_REPO_TOKEN:
104104
required: false
105-
NODE_VERSION:
106-
required: false
107-
PYTHON_VERSION:
108-
required: false
109105
ENV_PASSWORD:
110106
required: false
111107
CYPRESS_ENV:
@@ -114,11 +110,6 @@ on:
114110
required: false
115111

116112
env:
117-
NPM_REGISTRY: "https://registry.npmjs.org/"
118-
NODE_VERSION: ${{ vars.NODE_VERSION || '20.9' }}
119-
PYPI_REGISTRY: "https://upload.pypi.org/legacy/"
120-
PYPI_USERNAME: "datavisyn"
121-
PYTHON_VERSION: ${{ vars.PYTHON_VERSION || '3.10' }}
122113
WORKFLOW_BRANCH: "mp/node_version"
123114
POSTGRES_HOSTNAME: postgres_${{ github.job }}_${{ inputs.deduplication_id }}_${{ github.run_id }}_${{ github.run_attempt }}
124115

@@ -161,9 +152,8 @@ jobs:
161152
# We probably won't need Rust on Node builds...
162153
# enable_rust: ${{ inputs.rust_enable }}
163154
run_parallel: ${{ inputs.run_parallel }}
164-
node_version: ${{ inputs.node_version || secrets.NODE_VERSION || env.NODE_VERSION }}
165-
npm_registry: ${{ env.NPM_REGISTRY }}
166-
python_version: ${{ inputs.python_version || secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
155+
node_version: ${{ inputs.node_version }}
156+
python_version: ${{ inputs.python_version }}
167157
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
168158
run_node_bundle: ${{ inputs.node_run_webpack }}
169159
enable_node_cache: ${{ inputs.runs_on != 'self-hosted' }}
@@ -202,9 +192,8 @@ jobs:
202192
enable_python: true
203193
enable_rust: ${{ inputs.rust_enable }}
204194
run_parallel: ${{ inputs.run_parallel }}
205-
node_version: ${{ inputs.node_version || secrets.NODE_VERSION || env.NODE_VERSION }}
206-
npm_registry: ${{ env.NPM_REGISTRY }}
207-
python_version: ${{ inputs.python_version || secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
195+
node_version: ${{ inputs.node_version }}
196+
python_version: ${{ inputs.python_version }}
208197
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
209198
run_node_bundle: ${{ inputs.node_run_webpack }}
210199
enable_node_cache: ${{ inputs.runs_on != 'self-hosted' }}
@@ -293,9 +282,8 @@ jobs:
293282
with:
294283
enable_rust: ${{ inputs.rust_enable }}
295284
run_parallel: ${{ inputs.run_parallel }}
296-
node_version: ${{ inputs.node_version || secrets.NODE_VERSION || env.NODE_VERSION }}
297-
npm_registry: ${{ env.NPM_REGISTRY }}
298-
python_version: ${{ inputs.python_version || secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
285+
node_version: ${{ inputs.node_version }}
286+
python_version: ${{ inputs.python_version }}
299287
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
300288
run_node_bundle: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
301289
enable_node_cache: ${{ inputs.cypress_runs_on != 'self-hosted' && inputs.runs_on != 'self-hosted' }}
@@ -436,9 +424,8 @@ jobs:
436424
with:
437425
enable_rust: ${{ inputs.rust_enable }}
438426
run_parallel: ${{ inputs.run_parallel }}
439-
node_version: ${{ inputs.node_version || secrets.NODE_VERSION || env.NODE_VERSION }}
440-
npm_registry: ${{ env.NPM_REGISTRY }}
441-
python_version: ${{ inputs.python_version || secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
427+
node_version: ${{ inputs.node_version }}
428+
python_version: ${{ inputs.python_version }}
442429
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
443430
run_node_bundle: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
444431
run_playwright_browser_install: true

.github/workflows/build-node.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,10 @@ on:
2828
secrets:
2929
DATAVISYN_BOT_REPO_TOKEN:
3030
required: false
31-
NODE_VERSION:
32-
required: false
3331
CHROMATIC_PROJECT_TOKEN:
3432
required: false
3533

3634
env:
37-
NPM_REGISTRY: "https://registry.npmjs.org/"
38-
NODE_VERSION: ${{ vars.NODE_VERSION || '20.9' }}
3935
WORKFLOW_BRANCH: "main"
4036

4137
permissions:
@@ -73,8 +69,7 @@ jobs:
7369
with:
7470
enable_node: true
7571
enable_python: false
76-
node_version: ${{ inputs.node_version || secrets.NODE_VERSION || env.NODE_VERSION }}
77-
npm_registry: ${{ env.NPM_REGISTRY }}
72+
node_version: ${{ inputs.node_version }}
7873
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
7974
run_node_bundle: ${{ inputs.node_run_webpack }}
8075
enable_node_cache: ${{ inputs.runs_on != 'self-hosted' }}

.github/workflows/build-python.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,8 @@ on:
1818
secrets:
1919
DATAVISYN_BOT_REPO_TOKEN:
2020
required: false
21-
PYTHON_VERSION:
22-
required: false
2321

2422
env:
25-
PYPI_REGISTRY: "https://upload.pypi.org/legacy/"
26-
PYPI_USERNAME: "test"
27-
PYTHON_VERSION: ${{ vars.PYTHON_VERSION || '3.10' }}
2823
WORKFLOW_BRANCH: "main"
2924

3025
permissions:
@@ -62,5 +57,5 @@ jobs:
6257
enable_node: false
6358
enable_python: true
6459
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
65-
python_version: ${{ inputs.python_version || secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
60+
python_version: ${{ inputs.python_version }}
6661
enable_python_cache: ${{ inputs.runs_on != 'self-hosted' }}

.github/workflows/publish-node-python.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,8 @@ on:
1919
required: true
2020
DATAVISYN_BOT_REPO_TOKEN:
2121
required: false
22-
NODE_VERSION:
23-
required: false
24-
PYTHON_VERSION:
25-
required: false
2622

2723
env:
28-
NODE_VERSION: ${{ vars.NODE_VERSION || '20.9' }}
29-
NPM_REGISTRY: "https://registry.npmjs.org/"
30-
PYPI_REGISTRY: "https://upload.pypi.org/legacy/"
31-
PYPI_USERNAME: "datavisyn"
32-
PYTHON_VERSION: ${{ vars.PYTHON_VERSION || '3.10' }}
3324
WORKFLOW_BRANCH: "main"
3425

3526
permissions:
@@ -71,8 +62,7 @@ jobs:
7162
with:
7263
enable_node: true
7364
enable_python: false
74-
node_version: ${{ inputs.node_version || secrets.NODE_VERSION || env.NODE_VERSION }}
75-
npm_registry: ${{ env.NPM_REGISTRY }}
65+
node_version: ${{ inputs.node_version }}
7666
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
7767
- uses: ./tmp/github-workflows/.github/actions/publish-node
7868
with:
@@ -104,10 +94,9 @@ jobs:
10494
with:
10595
enable_node: false
10696
enable_python: true
107-
python_version: ${{ inputs.python_version || secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
97+
python_version: ${{ inputs.python_version }}
10898
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
10999
- uses: ./tmp/github-workflows/.github/actions/publish-python
110100
with:
111-
pypi_registry: ${{ env.PYPI_REGISTRY }}
112101
pypi_username: ${{ secrets.PYPI_USERNAME }}
113102
pypi_password: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/publish-node.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@ on:
1212
required: true
1313
DATAVISYN_BOT_REPO_TOKEN:
1414
required: false
15-
NODE_VERSION:
16-
required: false
1715

1816
env:
19-
NPM_REGISTRY: "https://registry.npmjs.org/"
20-
NODE_VERSION: ${{ vars.NODE_VERSION || '20.9' }}
2117
WORKFLOW_BRANCH: "main"
2218

2319
permissions:
@@ -59,8 +55,7 @@ jobs:
5955
with:
6056
enable_node: true
6157
enable_python: false
62-
node_version: ${{ inputs.node_version || secrets.NODE_VERSION || env.NODE_VERSION }}
63-
npm_registry: ${{ env.NPM_REGISTRY }}
58+
node_version: ${{ inputs.node_version }}
6459
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
6560
- uses: ./tmp/github-workflows/.github/actions/publish-node
6661
with:

.github/workflows/publish-python.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ on:
1414
required: true
1515
DATAVISYN_BOT_REPO_TOKEN:
1616
required: false
17-
PYTHON_VERSION:
18-
required: false
1917

2018
env:
21-
PYPI_REGISTRY: "https://upload.pypi.org/legacy/"
22-
PYTHON_VERSION: ${{ vars.PYTHON_VERSION || '3.10' }}
2319
WORKFLOW_BRANCH: "main"
2420

2521
permissions:
@@ -56,10 +52,9 @@ jobs:
5652
with:
5753
enable_node: false
5854
enable_python: true
59-
python_version: ${{ inputs.python_version || secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
55+
python_version: ${{ inputs.python_version }}
6056
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
6157
- uses: ./tmp/github-workflows/.github/actions/publish-python
6258
with:
63-
pypi_registry: ${{ env.PYPI_REGISTRY }}
6459
pypi_username: ${{ secrets.PYPI_USERNAME }}
6560
pypi_password: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)