diff --git a/.github/workflows/smbios_ci.yml b/.github/workflows/smbios_ci.yml index 3724e44..db20316 100644 --- a/.github/workflows/smbios_ci.yml +++ b/.github/workflows/smbios_ci.yml @@ -1,26 +1,26 @@ name: smbioslib_ci on: - push: - branches: [ main ] + workflow_dispatch: + workflow_call: pull_request: - branches: [ main ] - types: [ labeled ] + branches: main env: CARGO_TERM_COLOR: always jobs: build: - if: ${{ github.event.label.name == 'Ready for Review' }} || github.event_name == 'push' runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + os: [macos-13, ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 - name: Build - run: cargo build --verbose + run: cargo build + - name: OS version + run: uname -a - name: Run tests - run: cargo test --verbose \ No newline at end of file + run: cargo test \ No newline at end of file diff --git a/README.md b/README.md index 783cb4f..108e6ef 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,16 @@ Specification 3.7.0](https://www.dmtf.org/sites/default/files/standards/document In early development. The current development stage is to finalize the API design. - + ## Dependencies * Windows - * libc = "^0.2" + * libc * MacOS - * libc = "^0.2" - * mach2 = "^0.4.1" - * core-foundation = "~0.9" - * core-foundation-sys = "~0.8" - * io-kit-sys = "^0.4.0" + * libc + * mach2 + * core-foundation + * core-foundation-sys + * io-kit-sys ## Security This library design follows a strict security mantra: *"Never trust the input"*. @@ -59,7 +59,7 @@ fn retrieve_system_uuid() { Some(uuid) => println!("System Information UUID == {:?}", uuid), None => println!("No System Information (Type 1) structure found with a UUID field"), }, - Err(err) => println!("failure: {:?}", err), + Err(err) => assert!(false, "Failure: {:?}", err) } } ``` @@ -84,7 +84,7 @@ fn print_all_memory_devices() { println!("{:#?}", memory_device); } } - Err(err) => println!("failure: {:?}", err), + Err(err) => assert!(false, "Failure: {:?}", err), } } ``` @@ -129,7 +129,7 @@ fn struct_struct_association() { } None => println!("No Memory Device (Type 17) structure found"), }, - Err(err) => println!("failure: {:?}", err), + Err(err) => assert!(false, "Failure: {:?}", err) } } ``` diff --git a/tests/integration_test.rs b/tests/integration_test.rs index f37ef03..2bfa119 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -18,7 +18,7 @@ fn retrieve_system_uuid() { Some(uuid) => println!("System Information UUID == {:?}", uuid), None => println!("No System Information (Type 1) structure found with a UUID field"), }, - Err(err) => println!("failure: {:?}", err), + Err(err) => assert!(false, "Failure: {:?}", err) } } @@ -29,8 +29,8 @@ fn print_all_memory_devices() { for memory_device in data.collect::() { println!("{:#?}", memory_device); } - } - Err(err) => println!("failure: {:?}", err), + }, + Err(err) => assert!(false, "Failure: {:?}", err) } } @@ -51,7 +51,7 @@ fn struct_struct_association() { } None => println!("No Memory Device (Type 17) structure found"), }, - Err(err) => println!("failure: {:?}", err), + Err(err) => assert!(false, "Failure: {:?}", err) } } @@ -68,7 +68,7 @@ fn find_first_cpu() { } None => println!("No Processor Information (Type 4) structure found that is a CPU with a populated socket"), }, - Err(err) => println!("Table load failure: {:?}", err), + Err(err) => assert!(false, "Failure: {:?}", err) } } @@ -76,7 +76,7 @@ fn find_first_cpu() { #[test] fn find_installed_memory() { match table_load_from_device() { - Err(err) => println!("Table load failure: {:?}", err), + Err(err) => assert!(false, "Failure: {:?}", err), Ok(data) => data .filter( |memory_device: &SMBiosMemoryDevice| match memory_device.size() {