|
1 | 1 | name: Docs Build
|
2 | 2 |
|
3 |
| -on: [ workflow_dispatch, push, pull_request ] |
| 3 | +on: [ workflow_dispatch, pull_request ] |
4 | 4 |
|
5 | 5 | jobs:
|
6 | 6 | doc_build:
|
7 | 7 | 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 |
8 | 15 |
|
9 | 16 | steps:
|
10 | 17 | - name: Check out repository
|
11 | 18 | uses: actions/checkout@v4
|
12 | 19 |
|
13 |
| - - name: Install dependencies |
| 20 | + - name: Install dependencies (linux only) |
| 21 | + if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} |
14 | 22 | run: |
|
15 | 23 | sudo apt-get update
|
16 | 24 | sudo apt-get install -y libdbus-1-dev pkg-config
|
17 | 25 |
|
18 | 26 | - name: Install Rust nightly
|
19 |
| - uses: dtolnay/rust-toolchain@stable |
| 27 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
20 | 28 | with:
|
| 29 | + target: ${{ matrix.target }} |
21 | 30 | toolchain: nightly
|
22 |
| - targets: x86_64-unknown-linux-gnu, aarch64-apple-darwin, aarch64-apple-ios, x86_64-pc-windows-msvc |
23 | 31 | components: rust-src
|
24 | 32 |
|
25 | 33 | - name: Build docs
|
26 | 34 | run: |
|
27 | 35 | 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 |
40 | 38 |
|
0 commit comments