@@ -14,18 +14,13 @@ jobs:
1414 runs-on : ubuntu-latest
1515
1616 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-
2517 - uses : actions/checkout@v3
2618 with :
2719 fetch-depth : 2
2820
21+ - name : Install CodeQL
22+ uses : ./.github/actions/fetch-codeql
23+
2924 - name : Check QLdoc coverage
3025 shell : bash
3126 run : |
@@ -34,15 +29,15 @@ jobs:
3429 changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!swift)[a-z]*/ql/lib' || true; } | sort -u)"
3530 for pack_dir in ${changed_lib_packs}; do
3631 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}"
3833 done
3934 git checkout HEAD^
4035 for pack_dir in ${changed_lib_packs}; do
4136 # When we add a new language, pack_dir would not exist in HEAD^.
4237 # In this case the right thing to do is to skip the check.
4338 [[ ! -d "${pack_dir}" ]] && continue
4439 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}"
4641 awk -F, '{gsub(/"/,""); if ($4==0 && $6=="public") print "\""$3"\"" }' "${RUNNER_TEMP}/${lang}-current.txt" | sort -u > "${RUNNER_TEMP}/current-undocumented.txt"
4742 awk -F, '{gsub(/"/,""); if ($4==0 && $6=="public") print "\""$3"\"" }' "${RUNNER_TEMP}/${lang}-baseline.txt" | sort -u > "${RUNNER_TEMP}/baseline-undocumented.txt"
4843 UNDOCUMENTED="$(grep -f <(comm -13 "${RUNNER_TEMP}/baseline-undocumented.txt" "${RUNNER_TEMP}/current-undocumented.txt") "${RUNNER_TEMP}/${lang}-current.txt" || true)"
0 commit comments