Skip to content

Commit 09c9c0d

Browse files
committed
using matrix for targets in doctest.yaml
1 parent 307e575 commit 09c9c0d

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

.github/workflows/doctest.yaml

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,38 @@
11
name: Docs Build
22

3-
on: [ workflow_dispatch, push, pull_request ]
3+
on: [ workflow_dispatch, pull_request ]
44

55
jobs:
66
doc_build:
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
target:
11+
- x86_64-unknown-linux-gnu
12+
- aarch64-apple-darwin
13+
- aarch64-apple-ios
14+
- x86_64-pc-windows-msvc
815

916
steps:
1017
- name: Check out repository
1118
uses: actions/checkout@v4
1219

13-
- name: Install dependencies
20+
- name: Install dependencies (linux only)
21+
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
1422
run: |
1523
sudo apt-get update
1624
sudo apt-get install -y libdbus-1-dev pkg-config
1725
1826
- name: Install Rust nightly
19-
uses: dtolnay/rust-toolchain@stable
27+
uses: actions-rust-lang/setup-rust-toolchain@v1
2028
with:
29+
target: ${{ matrix.target }}
2130
toolchain: nightly
22-
targets: x86_64-unknown-linux-gnu, aarch64-apple-darwin, aarch64-apple-ios, x86_64-pc-windows-msvc
2331
components: rust-src
2432

2533
- name: Build docs
2634
run: |
2735
FEATURES="apple-native, windows-native, linux-native-sync-persistent, crypto-rust"
28-
TARGETS=(
29-
"x86_64-unknown-linux-gnu"
30-
"aarch64-apple-darwin"
31-
"aarch64-apple-ios"
32-
"x86_64-pc-windows-msvc"
33-
)
34-
35-
for TARGET in "${TARGETS[@]}"; do
36-
echo "Building docs for $TARGET"
37-
RUSTDOCFLAGS="--cfg docsrs" \
38-
cargo +nightly doc --no-deps --features "$FEATURES" --target "$TARGET" -Zbuild-std
39-
done
36+
RUSTDOCFLAGS="--cfg docsrs" \
37+
cargo +nightly doc --no-deps --features "$FEATURES" --target ${{ matrix.target }} -Zbuild-std
4038

0 commit comments

Comments
 (0)