@@ -14,18 +14,13 @@ jobs:
14
14
runs-on : ubuntu-latest
15
15
16
16
steps :
17
- - name : Install CodeQL
18
- run : |
19
- gh extension install github/gh-codeql
20
- gh codeql set-channel nightly
21
- gh codeql version
22
- env :
23
- GITHUB_TOKEN : ${{ github.token }}
24
-
25
17
- uses : actions/checkout@v3
26
18
with :
27
19
fetch-depth : 2
28
20
21
+ - name : Install CodeQL
22
+ uses : ./.github/actions/fetch-codeql
23
+
29
24
- name : Check QLdoc coverage
30
25
shell : bash
31
26
run : |
@@ -34,15 +29,15 @@ jobs:
34
29
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!swift)[a-z]*/ql/lib' || true; } | sort -u)"
35
30
for pack_dir in ${changed_lib_packs}; do
36
31
lang="${pack_dir%/ql/lib}"
37
- gh codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-current.txt" --dir="${pack_dir}"
32
+ codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-current.txt" --dir="${pack_dir}"
38
33
done
39
34
git checkout HEAD^
40
35
for pack_dir in ${changed_lib_packs}; do
41
36
# When we add a new language, pack_dir would not exist in HEAD^.
42
37
# In this case the right thing to do is to skip the check.
43
38
[[ ! -d "${pack_dir}" ]] && continue
44
39
lang="${pack_dir%/ql/lib}"
45
- gh codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-baseline.txt" --dir="${pack_dir}"
40
+ codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-baseline.txt" --dir="${pack_dir}"
46
41
awk -F, '{gsub(/"/,""); if ($4==0 && $6=="public") print "\""$3"\"" }' "${RUNNER_TEMP}/${lang}-current.txt" | sort -u > "${RUNNER_TEMP}/current-undocumented.txt"
47
42
awk -F, '{gsub(/"/,""); if ($4==0 && $6=="public") print "\""$3"\"" }' "${RUNNER_TEMP}/${lang}-baseline.txt" | sort -u > "${RUNNER_TEMP}/baseline-undocumented.txt"
48
43
UNDOCUMENTED="$(grep -f <(comm -13 "${RUNNER_TEMP}/baseline-undocumented.txt" "${RUNNER_TEMP}/current-undocumented.txt") "${RUNNER_TEMP}/${lang}-current.txt" || true)"
0 commit comments