Skip to content

Commit db59c1e

Browse files
committed
ci: prefer using lowercase npm_config_* variables and strict error checking for bash scripts
1 parent 2ee2a0b commit db59c1e

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ variables:
1010
GH_PROJECT_PATH: "MatrixAI/${CI_PROJECT_NAME}"
1111
GH_PROJECT_URL: "https://${GITHUB_TOKEN}@github.com/${GH_PROJECT_PATH}.git"
1212
# Cache .npm
13-
NPM_CONFIG_CACHE: "${CI_PROJECT_DIR}/tmp/npm"
13+
npm_config_cache: "${CI_PROJECT_DIR}/tmp/npm"
1414
# Prefer offline node module installation
15-
NPM_CONFIG_PREFER_OFFLINE: "true"
15+
npm_config_prefer_offline: "true"
1616
# Homebrew cache only used by macos runner
1717
HOMEBREW_CACHE: "${CI_PROJECT_DIR}/tmp/Homebrew"
1818

scripts/build-platforms-generate.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/usr/bin/env bash
22

3+
set -o errexit # abort on nonzero exitstatus
4+
set -o nounset # abort on unbound variable
5+
set -o pipefail # don't hide errors within pipes
6+
37
shopt -s globstar
48
shopt -s nullglob
59

@@ -17,9 +21,9 @@ variables:
1721
GH_PROJECT_PATH: "MatrixAI/${CI_PROJECT_NAME}"
1822
GH_PROJECT_URL: "https://${GITHUB_TOKEN}@github.com/${GH_PROJECT_PATH}.git"
1923
# Cache .npm
20-
NPM_CONFIG_CACHE: "./tmp/npm"
24+
npm_config_cache: "${CI_PROJECT_DIR}/tmp/npm"
2125
# Prefer offline node module installation
22-
NPM_CONFIG_PREFER_OFFLINE: "true"
26+
npm_config_prefer_offline: "true"
2327
# Homebrew cache only used by macos runner
2428
HOMEBREW_CACHE: "${CI_PROJECT_DIR}/tmp/Homebrew"
2529

scripts/check-test-generate.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/usr/bin/env bash
22

3+
set -o errexit # abort on nonzero exitstatus
4+
set -o nounset # abort on unbound variable
5+
set -o pipefail # don't hide errors within pipes
6+
37
shopt -s globstar
48
shopt -s nullglob
59

@@ -17,9 +21,9 @@ variables:
1721
GH_PROJECT_PATH: "MatrixAI/${CI_PROJECT_NAME}"
1822
GH_PROJECT_URL: "https://${GITHUB_TOKEN}@github.com/${GH_PROJECT_PATH}.git"
1923
# Cache .npm
20-
NPM_CONFIG_CACHE: "./tmp/npm"
24+
npm_config_cache: "${CI_PROJECT_DIR}/tmp/npm"
2125
# Prefer offline node module installation
22-
NPM_CONFIG_PREFER_OFFLINE: "true"
26+
npm_config_prefer_offline: "true"
2327
# Homebrew cache only used by macos runner
2428
HOMEBREW_CACHE: "${CI_PROJECT_DIR}/tmp/Homebrew"
2529

0 commit comments

Comments
 (0)