Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
29b09fa
generate bindings
maxded Apr 24, 2025
6f93cdc
fix
maxded Apr 24, 2025
b8a971f
move into single workflow
maxded Apr 24, 2025
8478459
fix cross job
maxded Apr 24, 2025
974bfc9
fix..
maxded Apr 24, 2025
b3c8f82
generate bindings ci
maxded Apr 24, 2025
339228c
on push
maxded Apr 24, 2025
e819cbe
fix syntax
maxded Apr 24, 2025
82cace9
moar syntax
maxded Apr 24, 2025
60afef8
add target
maxded Apr 24, 2025
64b5b71
cross compile
maxded Apr 24, 2025
440a22e
fix build.rs
maxded Apr 24, 2025
5423a10
check
maxded Apr 24, 2025
9b5adeb
Windows on windows
maxded Apr 24, 2025
832a6de
add apple targets
maxded Apr 24, 2025
5cb898d
remove pregenerated bindings
maxded Apr 24, 2025
4ce62bc
fix bindings generation
maxded Apr 24, 2025
dea60a5
cleanup
maxded Apr 24, 2025
ba6c7c7
on push only
maxded Apr 24, 2025
8749f3c
Merge branch 'main' into generate-bindings
maxded Apr 24, 2025
803705e
remove armv7 test
maxded Apr 24, 2025
7cfdd7c
update bindgen and force rust target
maxded Apr 24, 2025
7f93635
remove rust target
maxded Apr 24, 2025
5504041
Update src/lib.rs
maxded Apr 24, 2025
c640950
remvoe info.text
maxded Apr 24, 2025
9226dea
Merge branch 'generate-bindings' of github.com:Traverse-Research/cpui…
maxded Apr 24, 2025
524acd1
update docs
maxded Apr 24, 2025
813c9a8
include 32bit targets
maxded Apr 24, 2025
ebabab4
add rust target to bindgen
maxded Apr 24, 2025
c5d8cd8
update proc-macro2 in minimal-versin check
maxded Apr 24, 2025
147179a
Update Cargo.toml
maxded Apr 25, 2025
4d17aae
feedback
maxded Apr 25, 2025
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
89 changes: 86 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
push:
pull_request:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the pull_request one as it would trigger our CI jobs twice which isn't needed.


jobs:
rust:
Expand All @@ -14,8 +15,6 @@ jobs:
run: cargo fmt --all -- --check
- name: Cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Cargo test
run: cargo test --workspace
Comment on lines -17 to -18
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this test here as it is already covered by another build step for all targets.


rust-msrv:
name: Build-test MSRV (1.74) with minimal crate dependencies
Expand All @@ -30,6 +29,90 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
- name: Generate minimal-version dependencies
run: cargo -Zminimal-versions generate-lockfile
# The latest bindgen release has an underspecified proc-macro2 dependency: https://github.com/rust-lang/rust-bindgen/issues/3149
- name: Update proc-macro2 to 1.0.80
run: cargo update -p proc-macro2 --precise 1.0.80
- uses: dtolnay/[email protected]
- name: Cargo check
run: cargo check --workspace --all-targets

cross:
name: ${{ matrix.name }} (${{ matrix.target }})
runs-on: ${{ matrix.os }}
env:
PROGRAM: ${{ matrix.cross && 'cross' || 'cargo' }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: Linux
cross: false
test: true

- target: x86_64-apple-darwin
os: macos-latest
name: macOS
cross: false
test: true

- os: windows-latest
name: Windows
target: x86_64-pc-windows-msvc
cross: false
test: true

# - os: ubuntu-latest
# name: FreeBSD
# target: x86_64-unknown-freebsd
# cross: true
# test: false

- target: aarch64-linux-android
os: ubuntu-latest
name: Android
cross: true
test: true

# - os: ubuntu-latest
# name: OpenWrt
# target: aarch64-unknown-linux-gnu
# cross: true
# test: true
# cargo_args: --features "openwrt"

# - target: armv7-unknown-linux-gnueabihf
# os: ubuntu-latest
# name: Linux ARMv7
# cross: true
# test: true
Comment on lines +85 to +89
Copy link
Contributor Author

@maxded maxded Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly a cross compile issue, not an actual issue with the code so removing the test step for now.

https://github.com/Traverse-Research/cpuinfo-rs/actions/runs/14644308875/job/41094360680


steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Bootstrap
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install cross
run: cargo install cross
if: ${{ matrix.cross }}

- name: Build
run: ${{ env.PROGRAM }} build --target=${{ matrix.target }} ${{ matrix.cargo_args }}

- name: Test
run: ${{ env.PROGRAM }} test --target=${{ matrix.target }} ${{ matrix.cargo_args }}
if: ${{ matrix.test }}

- name: Run example
run: cargo run --example info
- uses: actions/upload-artifact@v4
with:
name: info-${{ matrix.target }}
path: info.txt
95 changes: 0 additions & 95 deletions .github/workflows/cross.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/target
/Cargo.lock
info.txt
/info.txt
88 changes: 4 additions & 84 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ categories = ["hardware-support"] # https://crates.io/category_slugs
keywords = []
rust-version = "1.74"

[features]
generate_bindings = ["dep:bindgen"]

[dependencies]
bytemuck = "1"
serde = { version = "1", features = ["derive", "rc"] }
Expand All @@ -23,5 +20,5 @@ serde = { version = "1", features = ["derive", "rc"] }
serde_json = "1"

[build-dependencies]
bindgen = { version = "0.69", optional = true }
bindgen = "0.71"
cc = "1.1"
Loading