Skip to content

Commit cc0eb3c

Browse files
committed
ci: Fix documentation compilation commands
1 parent 03e95a8 commit cc0eb3c

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ runs:
2121
- name: Compile documentation (with SwiftPM)
2222
if: ${{ inputs.xcodebuild != true }} # Compare to constant to treat empty input as false
2323
run: |
24+
set -ex
25+
mkdir "$TARGET.doccarchive" && \
2426
swift package \
2527
--allow-writing-to-directory "$TARGET.doccarchive" \
2628
generate-documentation \
@@ -38,13 +40,17 @@ runs:
3840
- name: Compile documentation (with xcodebuild)
3941
if: ${{ inputs.xcodebuild == true }} # Compare to constant to treat empty input as false
4042
run: |
43+
set -ex
4144
destination=""
4245
if [[ $DEVICE_TYPE == "Mac" ]] || [[ $DEVICE_TYPE == "" ]]; then
4346
destination="platform=OS X"
4447
else
4548
destination="id=$(xcrun simctl list devices $devicetype available | grep -v -- -- | tail -n 1 | grep -oE '[0-9A-F\-]{36}')"
4649
fi
47-
xcodebuild -skipMacroValidation -scheme "$TARGET" -destination "$(destination)" docbuild | xcbeautify --renderer github-actions
50+
echo "$DEVICE_TYPE"
51+
echo "Building documentation for destination '$destination'"
52+
xcodebuild -skipMacroValidation -scheme "$TARGET" -destination "$destination" -derivedDataPath data docbuild | xcbeautify --renderer github-actions
53+
cp -R "data/Build/Products/Debug/$TARGET.doccarchive" "$TARGET.doccarchive"
4854
shell: bash
4955
env:
5056
TARGET: ${{ inputs.target }}

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
runs-on: macos-14
5656
strategy:
5757
matrix:
58-
devicetype:
58+
device-type:
5959
- iPhone
6060
- iPad
6161
- TV
@@ -71,11 +71,11 @@ jobs:
7171
- name: Build
7272
run: |
7373
set -uo pipefail
74-
devicetype=${{ matrix.devicetype }}
74+
device_type=${{ matrix.device-type }}
7575
set +e
76-
deviceid=$(xcrun simctl list devices $devicetype available | grep -v -- -- | tail -n 1 | grep -oE '[0-9A-F\-]{36}')
76+
deviceid=$(xcrun simctl list devices $device_type available | grep -v -- -- | tail -n 1 | grep -oE '[0-9A-F\-]{36}')
7777
if [ $? -eq 0 ]; then
78-
set -e
78+
set -ex
7979
(
8080
buildtarget () {
8181
xcodebuild -skipMacroValidation -scheme "$1" -destination "id=$deviceid" build | xcbeautify --renderer github-actions
@@ -93,29 +93,29 @@ jobs:
9393
buildtarget NotesExample
9494
buildtarget PathsExample
9595
96-
if [ $devicetype != TV ]; then
96+
if [ $device_type != TV ]; then
9797
# Slider is not implemented for tvOS
9898
buildtarget ControlsExample
9999
buildtarget RandomNumberGeneratorExample
100100
fi
101101
102-
if [ $devicetype = iPad ]; then
102+
if [ $device_type = iPad ]; then
103103
# NavigationSplitView is only implemented for iPad
104104
buildtarget SplitExample
105105
fi
106106
)
107107
else
108-
echo "No $devicetype simulators found" >&2
108+
echo "No $device_type simulators found" >&2
109109
fi
110110
111111
- name: Compile UIKitBackend docs
112-
if: ${{ matrix.devicetype == 'iPhone' }}
112+
if: ${{ matrix.device-type == 'iPhone' }}
113113
uses: ./.github/actions/compile-docs
114114
with:
115115
target: UIKitBackend
116116
upload: true
117117
xcodebuild: true
118-
xcodebuild_destination: ${{ matrix.devicetype }}
118+
xcodebuild-device-type: ${{ matrix.device-type }}
119119

120120
windows:
121121
runs-on: windows-latest

0 commit comments

Comments
 (0)