Skip to content

Commit 4a6f5f1

Browse files
ci/docs: Don't use all-features
Instead use cargo metadata for that while skipping win32/default and unsafe-assume-initialized feature
1 parent fb0ab2d commit 4a6f5f1

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/docs.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,26 @@ jobs:
7575
--extern-html-root-url=gl=https://docs.rs/gl/latest/
7676
--cfg docsrs
7777
-Zunstable-options --generate-link-to-definition
78+
79+
- name: Get features excluding some
80+
run: |
81+
FEATURES=$(cargo metadata --no-deps --format-version=1 | jq -r '
82+
[
83+
.packages[]
84+
| select(.manifest_path | test("book/listings|examples") | not)
85+
| {
86+
features: (.features | keys),
87+
optional_deps: [.dependencies[] | select(.optional == true) | .name]
88+
}
89+
]
90+
| map(.features - .optional_deps)
91+
| add
92+
| unique
93+
| map(select(. != "win32" and . != "default" and . != "unsafe-assume-initialized"))
94+
| join(",")')
95+
96+
echo "FEATURES=$FEATURES" >> $GITHUB_ENV
97+
7898
- uses: actions-rs/cargo@v1
7999
with:
80100
command: doc
@@ -87,7 +107,7 @@ jobs:
87107
-p gtk4 -p gtk4-sys
88108
-p gdk4-macos -p gdk4-macos-sys
89109
-p gtk4-macros
90-
--all-features
110+
--no-default-features --features "$FEATURES"
91111
--no-deps
92112
93113
- name: Fix broken URLs

0 commit comments

Comments
 (0)