Browse Source

ci: also build unstable feature

I forget this during the refactoring. :D
Philipp Schuster 2 years ago
parent
commit
3df6d9ee24
2 changed files with 19 additions and 7 deletions
  1. 13 7
      .github/workflows/_build-rust.yml
  2. 6 0
      .github/workflows/rust.yml

+ 13 - 7
.github/workflows/_build-rust.yml

@@ -17,16 +17,22 @@ on:
         required: false
         default: x86_64-unknown-linux-gnu
         description: Rust target for the build step. Clippy and tests are still executed with the default target.
+      features:
+        type: string
+        required: false
+        # Make sure we always an empty string to "--features <FEATURES>"
+        default: '""'
+        description: Comma-separated String with additional Rust features relevant for a certain job.
       do-style-check:
         type: boolean
         required: false
         default: true
-        description: Whether style checks should be done.
+        description: Perform code and doc style checks.
       do-test:
         type: boolean
         required: false
         default: true
-        description: Whether tests should be executed.
+        description: Execute tests.
 
 jobs:
   check_rust:
@@ -57,20 +63,20 @@ jobs:
           restore-keys: ${{ runner.os }}-cargo-${{ inputs.rust-version }}
       - run: cargo version
       - name: Build (library)
-        run: cargo build --target ${{ inputs.rust-target }}
+        run: cargo build --target ${{ inputs.rust-target }} --features ${{ inputs.features }}
       - name: Build (all targets)
-        run: cargo build --all-targets
+        run: cargo build --all-targets --features ${{ inputs.features }}
       - name: Code Formatting
         if: ${{ inputs.do-style-check }}
         run: cargo fmt --all -- --check
       - name: Code Style and Doc Style
         if: ${{ inputs.do-style-check }}
         run: |
-          cargo doc --document-private-items
-          cargo clippy --all-targets
+          cargo doc --document-private-items --features ${{ inputs.features }}
+          cargo clippy --all-targets --features ${{ inputs.features }}
       - name: Unit Test
         if: ${{ inputs.do-test }}
         run: |
           curl -LsSf https://get.nexte.st/latest/linux | tar zxf -
           chmod u+x cargo-nextest
-          ./cargo-nextest nextest run
+          ./cargo-nextest nextest run --features ${{ inputs.features }}

+ 6 - 0
.github/workflows/rust.yml

@@ -15,6 +15,7 @@ env:
   CARGO_TERM_COLOR: always
 
 jobs:
+  ### Regular Build  #########################
   build_msrv:
     name: build (msrv)
     uses: ./.github/workflows/_build-rust.yml
@@ -35,7 +36,9 @@ jobs:
     with:
       rust-version: nightly
       do-style-check: false
+      features: unstable
 
+  ### no-std Build   #########################
   build_nostd_msrv:
     name: build no_std (msrv)
     needs: build_msrv
@@ -62,7 +65,9 @@ jobs:
       rust-version: nightly
       do-style-check: false
       rust-target: thumbv7em-none-eabihf
+      features: unstable
 
+  ### Style Checks + Doc #####################
   style_msrv:
     name: style (msrv)
     needs: build_msrv
@@ -89,3 +94,4 @@ jobs:
       rust-version: nightly
       do-style-check: true
       do-test: false
+      features: unstable