Skip to content

Commit 0a83044

Browse files
committed
fix: honor npm workspaces
1 parent 4b6c326 commit 0a83044

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

.github/scripts/changed-modules.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ while IFS= read -r file; do
5656
done < <(find "${ROOT_DIR}" -maxdepth 1 -type f -not -name "package.json" -not -name "package-lock.json")
5757

5858
# define an array of modules that won't be part of the build
59-
readonly no_build_modules=("packages/modules/k6")
59+
readonly no_build_modules=()
6060

6161
# modules is an array that will store the paths of all the modules in the repository.
6262
modules=()
@@ -67,11 +67,7 @@ modules=()
6767
for packageJSONFile in $(find "${ROOT_DIR}" -name "package.json" -not -path "*/node_modules/*"); do
6868
name=$(basename "$(dirname "${packageJSONFile}")")
6969
if [[ "${name}" != "testcontainers-node" ]]; then
70-
if [[ "${name}" != "testcontainers" ]]; then
71-
modules+=("\"packages/modules/${name}\"")
72-
else
73-
modules+=("\"packages/testcontainers\"")
74-
fi
70+
modules+=("\"${name}\"")
7571
fi
7672
done
7773
# sort modules array
@@ -107,7 +103,7 @@ for file in $modified_files; do
107103
if [[ $file == packages/modules/* ]]; then
108104
module_name=$(echo $file | cut -d'/' -f3)
109105
if [[ ! " ${modified_modules[@]} " =~ " ${module_name} " ]]; then
110-
modified_modules+=("\"packages/modules/$module_name\"")
106+
modified_modules+=("\"$module_name\"")
111107
fi
112108
else
113109
# a file from the core module (packages/testcontainers) is modified, so include all modules in the list and stop the loop

.github/workflows/test-template.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ jobs:
136136
node-version: ${{ inputs.node-version }}
137137

138138
- name: Install dependencies
139-
working-directory: ${{ inputs.workspace }}
140139
run: npm ci --omit=optional
141140

142141
- name: Run tests
143-
working-directory: ${{ inputs.workspace }}
144-
run: npm run test:ci
142+
run: npm run test:ci -- ${{ inputs.workspace }}

.github/workflows/test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ jobs:
6464
with:
6565
node-version: 22.x
6666
- name: Install dependencies
67-
working-directory: ${{ matrix.module }}
6867
run: npm ci --omit=optional
6968
- name: Code linting
70-
working-directory: ${{ matrix.module }}
71-
run: npm run lint:ci
69+
run: npm run lint:ci -- ${{ matrix.module }}
7270

7371
smoke-test:
7472
# only run if there are modules to lint

0 commit comments

Comments
 (0)