Skip to content

Commit 6d83721

Browse files
feat: add preinstall script (#127)
* feat: add preinstall script * feat: run preinstall-deps in all github actions * fix: add --workspace attribute in install-deps script * fix: remove gaxios from install-deps scripts * fix: delete update-api-list.yaml * fix: remove preinstall issues-no-repro.yaml
1 parent 261b59a commit 6d83721

File tree

6 files changed

+49
-32
lines changed

6 files changed

+49
-32
lines changed

.github/workflows/continuous.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
with:
1717
version: ^10.0.0
1818
- run: node --version
19+
- run: npm run preinstall-deps
1920
- run: ci/run_conditional_tests.sh
2021
name: Run unit tests
2122
env:
@@ -29,6 +30,7 @@ jobs:
2930
- uses: actions/setup-node@v4
3031
with:
3132
node-version: 18
33+
- run: npm run preinstall-deps
3234
- run: npm install --engine-strict
3335
- run: npm test
3436
env:
@@ -40,6 +42,7 @@ jobs:
4042
- uses: actions/setup-node@v4
4143
with:
4244
node-version: 18
45+
- run: npm run preinstall-deps
4346
- run: npm install
4447
- run: npm run lint
4548
docs:
@@ -49,6 +52,7 @@ jobs:
4952
- uses: actions/setup-node@v4
5053
with:
5154
node-version: 18
55+
- run: npm run preinstall-deps
5256
- run: npm install
5357
- run: npm run docs
5458
- uses: JustinBeckwith/linkinator-action@v1

.github/workflows/presubmit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
with:
1616
version: ^10.0.0
1717
- run: node --version
18+
- run: npm run preinstall-deps
1819
- run: npm i && ci/run_conditional_tests.sh
1920
name: Run unit tests
2021
env:
@@ -27,6 +28,7 @@ jobs:
2728
- uses: actions/setup-node@v4
2829
with:
2930
node-version: 18
31+
- run: npm run preinstall-deps
3032
- run: npm install
3133
- run: npm run lint
3234
docs:
@@ -36,6 +38,7 @@ jobs:
3638
- uses: actions/setup-node@v4
3739
with:
3840
node-version: 18
41+
- run: npm run preinstall-deps
3942
- run: npm install
4043
- run: npm run docs
4144
- uses: JustinBeckwith/linkinator-action@v1

.github/workflows/update-api-list.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

bin/install-deps.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
#
3+
# A script to install dependencies for specified packages in order.
4+
5+
# Exit on any error.
6+
set -eo pipefail
7+
8+
echo "Installing dependencies in order..."
9+
10+
# Define the packages to install in the desired order.
11+
# These will be installed from the npm registry.
12+
declare -a packages=(
13+
"jsdoc-fresh"
14+
"pack-n-play"
15+
"jsdoc-region-tag"
16+
"gcp-metadata"
17+
)
18+
19+
for package in "${packages[@]}"; do
20+
echo "--- Installing $package ---"
21+
npm install --workspace="$package"
22+
done
23+
24+
echo "All specified dependencies installed successfully."

package-lock.json

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"url": "https://github.com/googleapis/google-cloud-node-core/issues"
1717
},
1818
"scripts": {
19+
"preinstall-deps": "./bin/install-deps.sh",
1920
"test": "npm test --ws",
2021
"samples-test": "npm run samples-test --ws",
2122
"system-test": "npm run system-test --ws",
@@ -27,5 +28,12 @@
2728
"workspaces": [
2829
"dev-packages/*",
2930
"packages/*"
30-
]
31+
],
32+
"dependencies": {
33+
"gaxios": "^7.1.2",
34+
"gcp-metadata": "^8.1.1",
35+
"jsdoc-fresh": "^5.0.2",
36+
"jsdoc-region-tag": "^4.0.1",
37+
"pack-n-play": "^4.2.1"
38+
}
3139
}

0 commit comments

Comments
 (0)