Skip to content

Commit 6078937

Browse files
authored
Update dock check syntax issue (#290)
Fixes: #291
1 parent d65527a commit 6078937

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

.github/workflows/scripts/check-docs.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ done
8181

8282
if [ -z "${docs_targets}" ] ; then
8383
if [ ! -f .spi.yml ]; then
84-
log "No '.spi.yml' found, no documentation targets to check."
84+
log "No '.spi.yml' found in \"$(pwd)\", no documentation targets to check."
8585
exit 0
8686
fi
8787
fi
@@ -94,12 +94,12 @@ if ! command -v yq &> /dev/null; then
9494
fi
9595

9696
if [ -z "${docs_targets}" ] ; then
97-
docs_targets=$(yq ".builder.configs[] | select(.documentation_targets[] != \"\") | .documentation_targets[]" .spi.yml)
97+
docs_targets=$(yq -r ".builder.configs[] | select(.documentation_targets[] != \"\") | .documentation_targets[]" .spi.yml)
9898
fi
9999

100100
package_files=$(find . -maxdepth 1 -name 'Package*.swift')
101101
if [ -z "$package_files" ]; then
102-
fatal "Package.swift not found. Please ensure you are running this script from the root of a Swift package."
102+
fatal "Package.swift not found in \"$(pwd)\". Please ensure you are running this script from the root of a Swift package."
103103
fi
104104

105105
# yq 3.1.0-3 doesn't have filter, otherwise we could replace the grep call with "filter(.identity == "swift-docc-plugin") | keys | .[]"

.github/workflows/soundness.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ on:
1818
api_breakage_check_container_image:
1919
type: string
2020
description: "Container image for the API breakage check job. Defaults to latest Swift Ubuntu image."
21-
default: "swift:6.2-noble"
21+
default: "swift:6.3-noble"
2222
docs_check_enabled:
2323
type: boolean
2424
description: "Boolean to enable the docs check job. Defaults to true."
2525
default: true
2626
docs_check_container_image:
2727
type: string
2828
description: "Container image for the docs check job. Defaults to latest Swift Ubuntu image."
29-
default: "swift:6.2-noble"
29+
default: "swift:6.3-noble"
3030
docs_check_additional_arguments:
3131
type: string
3232
description: "Additional arguments that should be passed to docc"
@@ -94,7 +94,7 @@ on:
9494
format_check_container_image:
9595
type: string
9696
description: "Container image for the format check job. Defaults to latest Swift Ubuntu image."
97-
default: "swift:6.2-noble"
97+
default: "swift:6.3-noble"
9898
shell_check_enabled:
9999
type: boolean
100100
description: "Boolean to enable the shell check job. Defaults to true."
@@ -200,23 +200,21 @@ jobs:
200200
else
201201
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
202202
fi
203-
- name: Pre-build
204-
if: ${{ inputs.linux_pre_build_command }}
205-
# zizmor: ignore[template-injection]
206-
run: ${{ inputs.linux_pre_build_command }}
207203
- name: Run documentation check
208204
env:
209205
ADDITIONAL_DOCC_ARGUMENTS: ${{ inputs.docs_check_additional_arguments }}
210206
DOCC_ANALYZE: ${{ inputs.docs_check_analyze }}
211207
DOCS_TARGETS: ${{ inputs.docs_check_targets}}
212208
SCRIPT_ROOT: ${{ steps.script_path.outputs.root }}
213209
run: |
210+
set -x
211+
${{ inputs.linux_pre_build_command }}
214212
analyze_arg=""
215213
doc_target_arg=""
216-
if [[ "${DOCS_TARGETS}" != "" ]] ; then
214+
if [ "${DOCS_TARGETS}" != "" ] ; then
217215
doc_target_arg="--doc-targets ${DOCS_TARGETS}"
218216
fi
219-
if [[ "${DOCC_ANALYZE}" != "true" ]]; then
217+
if [ "${DOCC_ANALYZE}" != "true" ]; then
220218
analyze_arg="--no-analyze"
221219
fi
222220
"${SCRIPT_ROOT}/.github/workflows/scripts/check-docs.sh" ${analyze_arg} ${doc_target_arg} --additional-docc-arguments ${ADDITIONAL_DOCC_ARGUMENTS}
@@ -263,12 +261,13 @@ jobs:
263261
run: |
264262
analyze_arg=""
265263
doc_target_arg=""
266-
if [[ "${DOCS_TARGETS}" != "" ]] ; then
264+
if [ "${DOCS_TARGETS}" != "" ] ; then
267265
doc_target_arg="--doc-targets ${DOCS_TARGETS}"
268266
fi
269-
if [[ "${DOCC_ANALYZE}" != "true" ]]; then
267+
if [ "${DOCC_ANALYZE}" != "true" ]; then
270268
analyze_arg="--no-analyze"
271269
fi
270+
set -x
272271
"${SCRIPT_ROOT}/.github/workflows/scripts/check-docs.sh" ${analyze_arg} ${doc_target_arg} --additional-docc-arguments ${ADDITIONAL_DOCC_ARGUMENTS}
273272
274273
unacceptable-language-check:

0 commit comments

Comments
 (0)