Skip to content

Commit 1e907a2

Browse files
committed
CI: replace '--all-features' with specific feature list
1 parent 5b26d26 commit 1e907a2

File tree

5 files changed

+33
-23
lines changed

5 files changed

+33
-23
lines changed

.github/workflows/doc.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ on:
1414

1515

1616
env:
17-
GDNATIVE_LIB_RS_PREFIX: |-
17+
GDRUST_LIB_RS_PREFIX: |-
1818
//! _**Note:** This documentation refers to the [latest GitHub version](https://github.com/godot-rust/godot-rust) and is subject to change._<br>
1919
//! _For stable releases, visit [docs.rs/gdnative](https://docs.rs/gdnative)._
2020
//! <br><br>
2121
//!
22-
GDNATIVE_DOC_REPO: [email protected]:godot-rust/docs.git
23-
GDNATIVE_DOC_BRANCH: gh-pages
22+
GDRUST_DOC_REPO: [email protected]:godot-rust/docs.git
23+
GDRUST_DOC_BRANCH: gh-pages
24+
GDRUST_FEATURES: "async,serde"
2425

2526

2627
# In the very unlikely cases where two PRs are merged, and the first 'doc' job is still running when the 2nd 'full-ci' starts,
@@ -46,13 +47,13 @@ jobs:
4647
- name: "Pre-process input"
4748
run: |
4849
mv ${GITHUB_WORKSPACE}/gdnative/src/lib.rs tmp_lib.rs
49-
(echo "${GDNATIVE_LIB_RS_PREFIX}"; cat tmp_lib.rs) > ${GITHUB_WORKSPACE}/gdnative/src/lib.rs
50+
(echo "${GDRUST_LIB_RS_PREFIX}"; cat tmp_lib.rs) > ${GITHUB_WORKSPACE}/gdnative/src/lib.rs
5051
5152
- name: "Generate documentation"
5253
uses: actions-rs/cargo@v1
5354
with:
5455
command: doc
55-
args: -p gdnative --lib --no-deps --all-features
56+
args: -p gdnative --lib --no-deps --features ${GDRUST_FEATURES}
5657

5758
# For email address, see https://github.community/t/github-actions-bot-email-address/17204
5859
# As search-index.js changes every time, even if source hasn't changed, this will not need 'git commit --allow-empty'
@@ -65,25 +66,25 @@ jobs:
6566
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
6667
6768
mkdir doc && cd doc
68-
git clone --single-branch --branch ${GDNATIVE_DOC_BRANCH} --no-checkout ${GDNATIVE_DOC_REPO} . \
69-
|| (git init -b ${GDNATIVE_DOC_BRANCH} && git remote add origin ${GDNATIVE_DOC_REPO})
69+
git clone --single-branch --branch ${GDRUST_DOC_BRANCH} --no-checkout ${GDRUST_DOC_REPO} . \
70+
|| (git init -b ${GDRUST_DOC_BRANCH} && git remote add origin ${GDRUST_DOC_REPO})
7071
7172
mv ${GITHUB_WORKSPACE}/target/doc/* .
7273
mv ${GITHUB_WORKSPACE}/.github/workflows/doc/* .
7374
74-
GDNATIVE_VERSION=$(grep -Po '^version = "\K[^"]*' ${GITHUB_WORKSPACE}/gdnative/Cargo.toml)
75-
GDNATIVE_SHORT_SHA=$(git rev-parse --short "${GITHUB_SHA}")
75+
GDRUST_VERSION=$(grep -Po '^version = "\K[^"]*' ${GITHUB_WORKSPACE}/gdnative/Cargo.toml)
76+
GDRUST_SHORT_SHA=$(git rev-parse --short "${GITHUB_SHA}")
7677
77-
find gdnative -name .html -o -type f -print0 | xargs -0 sed -i 's/'"${GDNATIVE_VERSION}"'/master/g'
78+
find gdnative -name .html -o -type f -print0 | xargs -0 sed -i 's/'"${GDRUST_VERSION}"'/master/g'
7879
7980
git add --all
80-
git commit -m "Sync doc from ${GDNATIVE_SHORT_SHA}
81+
git commit -m "Sync doc from ${GDRUST_SHORT_SHA}
8182
8283
Revision in godot-rust: ${GITHUB_SHA}"
8384
8485
- name: "Upload"
8586
working-directory: doc
86-
run: git push origin ${GDNATIVE_DOC_BRANCH}
87+
run: git push origin ${GDRUST_DOC_BRANCH}
8788

8889
- name: "Cleanup"
8990
run: shred -u ~/.ssh/id_rsa

.github/workflows/full-ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ env:
3434
# Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480
3535
GODOT_VER: "3.4"
3636
GODOT_REL: stable
37+
GDRUST_FEATURES: "gdnative/async,gdnative/serde"
3738

3839
on:
3940
push:
@@ -77,7 +78,7 @@ jobs:
7778
rust: ${{ matrix.rust.toolchain }}
7879
components: clippy
7980
- name: Check clippy
80-
run: cargo clippy --workspace --all-features -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
81+
run: cargo clippy --workspace --features ${GDRUST_FEATURES} -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
8182

8283
test:
8384
name: test-${{ matrix.os.name }}${{ matrix.rust.postfix }}
@@ -119,9 +120,9 @@ jobs:
119120
uses: ./.github/composite/llvm
120121
if: ${{ matrix.os.id == 'windows-latest' }}
121122
- name: Compile tests
122-
run: cargo test --workspace --all-features --no-run;
123+
run: cargo test --workspace --features ${GDRUST_FEATURES} --no-run;
123124
- name: Test
124-
run: cargo test --workspace --all-features ${{ matrix.testflags }};
125+
run: cargo test --workspace --features ${GDRUST_FEATURES} ${{ matrix.testflags }};
125126

126127
build-release:
127128
name: build-release-${{ matrix.os.name }}

.github/workflows/minimal-ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
# Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480
1515
GODOT_VER: "3.4"
1616
GODOT_REL: stable
17+
GDRUST_FEATURES: "gdnative/async,gdnative/serde"
1718

1819
on:
1920
pull_request:
@@ -53,7 +54,7 @@ jobs:
5354
rust: stable
5455
components: clippy
5556
- name: Check clippy
56-
run: cargo clippy --workspace --all-features -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
57+
run: cargo clippy --workspace --features ${GDRUST_FEATURES} -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
5758

5859
unit-test:
5960
runs-on: ubuntu-latest
@@ -62,9 +63,9 @@ jobs:
6263
- name: Install Rust
6364
uses: ./.github/composite/rust
6465
- name: Compile tests
65-
run: cargo test --workspace --all-features --no-run;
66+
run: cargo test --workspace --features ${GDRUST_FEATURES} --no-run;
6667
- name: Test
67-
run: cargo test --workspace --all-features;
68+
run: cargo test --workspace --features ${GDRUST_FEATURES};
6869

6970
integration-test-godot:
7071
runs-on: ubuntu-latest

.github/workflows/release-version.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- '0.9.[0-9]+'
99
- '0.10.[0-9]+'
1010

11+
env:
12+
GDRUST_FEATURES: "gdnative/async,gdnative/serde"
13+
1114
defaults:
1215
run:
1316
shell: bash
@@ -18,17 +21,20 @@ jobs:
1821
environment: Deploy
1922
steps:
2023
- uses: actions/checkout@v2
24+
2125
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f
2226
with:
2327
profile: minimal
2428
toolchain: stable
2529
components: rustfmt, clippy
26-
- name: Sanity tests
30+
31+
- name: "Sanity tests"
2732
run: |
2833
cargo fmt --all -- --check;
29-
cargo clippy --all --all-features -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
30-
cargo test --all --all-features;
31-
- name: Publishing to crates.io
34+
cargo clippy --workspace --features ${GDRUST_FEATURES} -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
35+
cargo test --workspace --features ${GDRUST_FEATURES};
36+
37+
- name: "Publish to crates.io"
3238
env:
3339
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
3440
run: |

gdnative/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ gdnative-async = { optional = true, path = "../gdnative-async", version = "=0.9.
3434
trybuild = "1.0.50"
3535
rustversion = "1.0.5"
3636

37+
# See https://docs.rs/about/metadata
3738
[package.metadata.docs.rs]
38-
all-features = true
39+
features = ["async", "serde"]

0 commit comments

Comments
 (0)