Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI configuration slightly #366

Merged
merged 11 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/bloat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on: # rebuild any PRs and main branch changes
on:
pull_request:
push:
branches:
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install rust
uses: actions-rs/toolchain@v1
Expand Down
79 changes: 17 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,86 +8,43 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
profile: minimal
override: true
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt --all -- --check

# Static analyzer.
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
profile: minimal
override: true
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --all-features -- -D warnings

# Security audit.
audit:
name: Security audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo clippy --all-targets --all-features -- -D warnings

# Check links in the documentation.
deadlinks:
name: Deadlinks
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install deadlinks
run: cargo install cargo-deadlinks
- name: Cargo doc
run: cargo doc --no-deps -p os_info
- name: Run deadlinks
run: cargo deadlinks --no-build
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo install cargo-deadlinks
- run: cargo doc --no-deps -p os_info
- run: cargo deadlinks --no-build

# Check links in markdown files.
mlc:
name: MLC
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Markup Link Checker (mlc)
uses: becheran/[email protected]
- uses: actions/checkout@v3
- uses: becheran/[email protected]

# Spellcheck.
spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: streetsidesoftware/[email protected]
with:
files: "**/*.{rs,md}"
Expand All @@ -97,10 +54,8 @@ jobs:
name: Markdown lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Check md files
uses: nosborn/[email protected]
- uses: actions/checkout@v3
- uses: nosborn/[email protected]
with:
files: .

Expand All @@ -109,7 +64,7 @@ jobs:
name: cargo-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1

# Tests.
Expand Down
28 changes: 9 additions & 19 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,20 @@ jobs:
check:
name: Tarpaulin
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
version: latest
args: '-- --test-threads 1'
- name: Generate code coverage
run: |
cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml

- name: Upload to codecov.io
uses: codecov/codecov-action@v1.0.2
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}

- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml
fail_ci_if_error: true
26 changes: 0 additions & 26 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install rust
uses: actions-rs/toolchain@v1
with:
# Feel free to bump this version if you need features of newer Rust.
# Sync with badge in README.md
toolchain: 1.60.0
toolchain: 1.72.0
profile: minimal
override: true

Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[workspace]

members = [
"os_info",
"cli",
]

[workspace.dependencies]
log = "0.4"
6 changes: 3 additions & 3 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ keywords = ["cli", "os", "os_type", "os_version", "os_info"]
categories = ["command-line-interface", "os"]
license = "MIT"
edition = "2018"
rust-version = "1.60"
rust-version = "1.76"

[[bin]]
name = "os_info"
path = "src/main.rs"

[dependencies]
os_info = { version = "3.7.0", default-features = false, path = "../os_info" }
log = "0.4.5"
env_logger = "0.10"
log.workspace = true
env_logger = "0.11"
clap = { version = "4", features = ["derive"] }

[dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions cspell-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ clippy
clearos
concat
coreos
cpus
devuan
earmv
emscripten
Expand Down Expand Up @@ -53,5 +54,6 @@ xenenterprise
xenial
xenserver
ultramarine
uninit
voidlinux
kuma
12 changes: 6 additions & 6 deletions os_info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ rust-version = "1.60"
default = ["serde"]

[dependencies]
log = "0.4.5"
log.workspace = true
serde = { version = "1", features = ["derive"], optional = true }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.45", features = [
windows-sys = { version = "0.52", features = [
"Win32_Foundation",
"Win32_System_Diagnostics_Debug",
"Win32_System_LibraryLoader",
"Win32_System_SystemInformation",
"Win32_UI_WindowsAndMessaging",
"Win32_System_Registry",
"Win32_System_SystemInformation",
"Win32_System_SystemServices",
"Win32_System_Threading",
"Win32_UI_WindowsAndMessaging",
]}

[dev-dependencies]
pretty_assertions = "1"
doc-comment = "0.3.1"
doc-comment = "0.3"
10 changes: 5 additions & 5 deletions os_info/src/windows/winapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ use std::{
use windows_sys::Win32::{
Foundation::{ERROR_SUCCESS, FARPROC, NTSTATUS, STATUS_SUCCESS},
System::{
Diagnostics::Debug::{
PROCESSOR_ARCHITECTURE_AMD64, PROCESSOR_ARCHITECTURE_ARM, PROCESSOR_ARCHITECTURE_IA64,
PROCESSOR_ARCHITECTURE_INTEL,
},
LibraryLoader::{GetModuleHandleA, GetProcAddress},
Registry::{RegOpenKeyExW, RegQueryValueExW, HKEY_LOCAL_MACHINE, KEY_READ, REG_SZ},
SystemInformation::{GetNativeSystemInfo, GetSystemInfo, SYSTEM_INFO},
SystemInformation::{
GetNativeSystemInfo, GetSystemInfo, PROCESSOR_ARCHITECTURE_AMD64,
PROCESSOR_ARCHITECTURE_ARM, PROCESSOR_ARCHITECTURE_IA64, PROCESSOR_ARCHITECTURE_INTEL,
SYSTEM_INFO,
},
SystemServices::{VER_NT_WORKSTATION, VER_SUITE_WH_SERVER},
},
UI::WindowsAndMessaging::{GetSystemMetrics, SM_SERVERR2},
Expand Down
Loading