Skip to content

Commit 3969478

Browse files
committed
ci: Update iOS derived data path, 'fix' docc command for Windows/Linux
1 parent 76dcb16 commit 3969478

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/actions/compile-docs/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ runs:
2323
run: |
2424
set -ex
2525
mkdir "$TARGET.doccarchive" && \
26+
# We use --disable-sandbox instead of --allow-writing-to-directory because
27+
# Linux and Windows throw tantrums about not being able to write to tmp (even
28+
# though when I try locally I face no issues...)
2629
swift package \
27-
--allow-writing-to-directory . \
30+
--disable-sandbox \
2831
generate-documentation \
2932
--target "$TARGET" \
3033
--disable-indexing \
@@ -51,8 +54,8 @@ runs:
5154
fi
5255
echo "$DEVICE_TYPE"
5356
echo "Building documentation for destination '$destination'"
54-
xcodebuild -skipMacroValidation -scheme "$TARGET" -destination "$destination" -derivedDataPath data docbuild | xcbeautify --renderer github-actions
55-
cp -R "data/Build/Products/Debug/$TARGET.doccarchive" "$TARGET.doccarchive"
57+
xcodebuild -skipMacroValidation -scheme "$TARGET" -destination "$destination" -derivedDataPath /tmp/data docbuild | xcbeautify --renderer github-actions
58+
cp -R "/tmp/data/Build/Products/Debug/$TARGET.doccarchive" "$TARGET.doccarchive"
5659
shell: bash
5760
env:
5861
TARGET: ${{ inputs.target }}

.github/workflows/build-test-and-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ jobs:
8484
set -ex
8585
(
8686
buildtarget () {
87-
xcodebuild -skipMacroValidation -scheme "$1" -destination "id=$deviceid" build | xcbeautify --renderer github-actions
87+
# Use the same derived data path as DocC compilation so that we don't duplicate work.
88+
xcodebuild -derivedDataPath /tmp/data -skipMacroValidation -scheme "$1" -destination "id=$deviceid" build | xcbeautify --renderer github-actions
8889
}
8990
9091
buildtarget SwiftCrossUI

0 commit comments

Comments
 (0)