Skip to content

Commit

Permalink
Fixing ts-node-cache in child pipeline by not inheriting variables fr…
Browse files Browse the repository at this point in the history
…om the parent pipeline
  • Loading branch information
CMCDragonkai committed Jan 9, 2022
1 parent 8387c79 commit 74bec18
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ variables:
# Prefer offline node module installation
NPM_CONFIG_PREFER_OFFLINE: "true"
# `ts-node` has its own cache
TS_CACHED_TRANSPILE_CACHE: "./tmp/ts-node-cache"
# It must use an absolute path, otherwise ts-node calls will CWD
TS_CACHED_TRANSPILE_CACHE: "${CI_PROJECT_DIR}/tmp/ts-node-cache"
TS_CACHED_TRANSPILE_PORTABLE: "true"

# Cached directories shared between jobs & pipelines per-branch
cache:
Expand Down Expand Up @@ -60,6 +62,12 @@ test-generate:

test:
stage: test
# Don't implicitly inherit top-level variables in child pipeline
# All inherited variables should be explicitly defined here
# Note that variables defined here override any variables defined in the child pipeline
# This causes a bug with $CI_PROJECT_DIR, which is expanded into an empty string
inherit:
variables: false
trigger:
include:
- artifact: tmp/test-pipelines.yml
Expand Down
4 changes: 3 additions & 1 deletion scripts/test-pipelines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ variables:
# Prefer offline node module installation
NPM_CONFIG_PREFER_OFFLINE: "true"
# `ts-node` has its own cache
TS_CACHED_TRANSPILE_CACHE: "./tmp/ts-node-cache"
# It must use an absolute path, otherwise ts-node calls will CWD
TS_CACHED_TRANSPILE_CACHE: "${CI_PROJECT_DIR}/tmp/ts-node-cache"
TS_CACHED_TRANSPILE_PORTABLE: "true"
# Cached directories shared between jobs & pipelines per-branch
cache:
Expand Down

0 comments on commit 74bec18

Please sign in to comment.