Skip to content

Commit cf269f7

Browse files
committed
Index the cds files at the appropriate path during tests
- Index the .cds files in addition to the .cds.json files - Run the cds compiler at the appropriate path
1 parent 7040473 commit cf269f7

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

.github/workflows/run-codeql-unit-tests-javascript.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,20 @@ jobs:
8787
# Compile .cds files to .cds.json files.
8888
- name: Compile CAP CDS files
8989
run: |
90-
for cds_file in $(find . -type f \( -iname '*.cds' \) -print)
90+
for test_dir in $(find . -type f -name '*.expected' -exec dirname {} \;);
9191
do
92-
echo "I am compiling $cds_file"
93-
cds compile $cds_file \
94-
-2 json \
95-
-o "$cds_file.json" \
96-
--locations
92+
# The CDS compiler produces locations relative to the working directory
93+
# so we switch to the test directory before running the compiler.
94+
pushd $test_dir
95+
for cds_file in $(find . -type f \( -iname '*.cds' \) -print)
96+
do
97+
echo "I am compiling $cds_file"
98+
cds compile $cds_file \
99+
-2 json \
100+
-o "$cds_file.json" \
101+
--locations
102+
done
103+
popd
97104
done
98105
99106
- name: Run test suites
@@ -105,7 +112,7 @@ jobs:
105112
CODEQL_STDLIB_IDENT: ${{matrix.codeql_standard_library_ident}}
106113
RUNNER_TMP: ${{ runner.temp }}
107114
LGTM_INDEX_XML_MODE: all
108-
LGTM_INDEX_FILETYPES: ".json:JSON"
115+
LGTM_INDEX_FILETYPES: ".json:JSON\n.cds:JSON"
109116

110117
shell: bash
111118
run: >

0 commit comments

Comments
 (0)