-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
105 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,35 @@ | ||
on: [push, pull_request] | ||
|
||
name: build | ||
|
||
jobs: | ||
lint: | ||
name: Format and Clippy | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
uses: actions/checkout@v4 | ||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
toolchain: 1.81.0 # We want to use a modern version of rust for better lints | ||
components: rustfmt, clippy | ||
|
||
- name: Run cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
run: cargo fmt --all -- --check | ||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all -- -D warnings | ||
|
||
run: cargo clippy --all -- -D warnings | ||
test: | ||
name: Test | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
uses: actions/checkout@v4 | ||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
toolchain: 1.32 # Ensure that tests past using MSRV | ||
override: true | ||
|
||
- name: Run cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
run: cargo test | ||
- name: Run cargo test for no-std | ||
run: cargo test --no-default-feature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This is here to make a working enviroment faster and easier to set up in NixOS. The use of bindgen in rust can be | ||
# tricky. If you don't use nixos, feel free to skip this. This project has very few deps and they are easy to set up | ||
# on other OSes | ||
let | ||
rust_overlay = import (builtins.fetchTarball | ||
# Head of master | ||
"https://github.com/oxalica/rust-overlay/archive/36d73192555e569d27579f6c486fea3ab768823c.tar.gz" | ||
); | ||
nixpkgs = import | ||
(builtins.fetchTarball | ||
# Head of nixos-24.05 | ||
"https://github.com/nixos/nixpkgs/archive/944b2aea7f0a2d7c79f72468106bc5510cbf5101.tar.gz" | ||
) | ||
{ overlays = [ rust_overlay ]; }; | ||
rust_toolchain = nixpkgs.rust-bin.nightly.latest.default; | ||
in | ||
nixpkgs.mkShell { | ||
buildInputs = [ | ||
rust_toolchain | ||
nixpkgs.libclang | ||
]; | ||
# Partially taken from here: https://hoverbear.org/blog/rust-bindgen-in-nix/ | ||
shellHook = '' | ||
export LIBCLANG_PATH=${nixpkgs.libclang.lib}/lib/ | ||
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${nixpkgs.stdenv.cc}/nix-support/libc-crt1-cflags) \ | ||
$(< ${nixpkgs.stdenv.cc}/nix-support/libc-cflags) \ | ||
$(< ${nixpkgs.stdenv.cc}/nix-support/cc-cflags) \ | ||
$(< ${nixpkgs.stdenv.cc}/nix-support/libcxx-cxxflags) \ | ||
${nixpkgs.lib.optionalString nixpkgs.stdenv.cc.isClang "-idirafter ${nixpkgs.stdenv.cc.cc}/lib/clang/${nixpkgs.lib.getVersion nixpkgs.stdenv.cc.cc}/include"} \ | ||
${nixpkgs.lib.optionalString nixpkgs.stdenv.cc.isGNU "-isystem ${nixpkgs.stdenv.cc.cc}/include/c++/${nixpkgs.lib.getVersion nixpkgs.stdenv.cc.cc} -isystem ${nixpkgs.stdenv.cc.cc}/include/c++/${nixpkgs.lib.getVersion nixpkgs.stdenv.cc.cc}/${nixpkgs.stdenv.hostPlatform.config} -idirafter ${nixpkgs.stdenv.cc.cc}/lib/gcc/${nixpkgs.stdenv.hostPlatform.config}/${nixpkgs.lib.getVersion nixpkgs.stdenv.cc.cc}/include"} | ||
" | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[package] | ||
name = "murmur3-sys" | ||
version = "0.1.0" | ||
authors = ["Stu Small <stuart.small@threat-x.com>"] | ||
authors = ["Stu Small <stuart.alan.small@gmail.com>"] | ||
|
||
[dependencies] | ||
|
||
[build-dependencies] | ||
bindgen = "0.53" | ||
bindgen = "0.70" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters