Ver Fonte

workflow: add check with `forward` extension enabled

Signed-off-by: Zhouqi Jiang <[email protected]>
Zhouqi Jiang há 1 ano atrás
pai
commit
42ff0d5550
4 ficheiros alterados com 16 adições e 5 exclusões
  1. 10 0
      .github/workflows/rust.yml
  2. 1 2
      Cargo.toml
  3. 1 1
      src/forward.rs
  4. 4 2
      tests/forward-struct.rs

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

@@ -59,6 +59,16 @@ jobs:
         with:
           command: check
           args: --target ${{ matrix.TARGET }} --features "machine" --verbose
+      - name: Check (forward)
+        uses: actions-rs/cargo@v1
+        with:
+          command: check
+          args: --target ${{ matrix.TARGET }} --features "forward" --verbose
+      - name: Check (machine + forward)
+        uses: actions-rs/cargo@v1
+        with:
+          command: check
+          args: --target ${{ matrix.TARGET }} --features "machine, forward" --verbose
 
   check-nightly:
     name: Cargo check (nightly)

+ 1 - 2
Cargo.toml

@@ -19,8 +19,7 @@ exclude = ["/.github"]
 [dependencies]
 sbi-spec = "0.0.7-alpha.3"
 riscv = { version = "0.10.1", optional = true }
-# TODO change to version number once sbi-rt releases a new version
-sbi-rt = { git = "https://github.com/rustsbi/sbi-rt", features = ["integer-impls"], optional = true }
+sbi-rt = { version = "0.0.3-rc.5", features = ["integer-impls"], optional = true }
 rustsbi-macros = { version = "0.4.0-alpha.1", path = "macros" }
 static_assertions = "1.1.0"
 

+ 1 - 1
src/forward.rs

@@ -495,7 +495,7 @@ impl Pmu for Forward {
             }
         }
     }
-    
+
     #[inline]
     fn counter_fw_read_hi(&self, counter_idx: usize) -> SbiRet {
         match () {

+ 4 - 2
tests/forward-struct.rs

@@ -1,9 +1,11 @@
-use rustsbi::{RustSBI, Forward};
+use rustsbi::{Forward, RustSBI};
 
 // The `Forward` structure must build
 
 #[derive(RustSBI)]
 struct ForwardAll {
-    #[rustsbi(console, cppc, hsm, ipi, nacl, pmu, reset, fence, sta, susp, timer, info)]
+    #[rustsbi(
+        console, cppc, hsm, ipi, nacl, pmu, reset, fence, sta, susp, timer, info
+    )]
     forward: Forward,
 }