forked from aldanor/fast-float-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from Alexhuszagh/audit
Add security audit to CI.
- Loading branch information
Showing
6 changed files
with
203 additions
and
13 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,27 @@ | ||
name: "Audit Dependencies" | ||
|
||
on: | ||
push: | ||
paths: | ||
# Run if workflow changes | ||
- '.github/workflows/audit.yml' | ||
# Run on changed dependencies | ||
- '**/Cargo.toml' | ||
- '**/Cargo.lock' | ||
# Run if the configuration file changes | ||
- '**/audit.toml' | ||
schedule: | ||
# run weekly | ||
- cron: '0 0 * * 0' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
audit: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
issues: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/audit@v1 | ||
name: Audit Rust Dependencies |
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,90 @@ | ||
name: Bench | ||
|
||
# TODO: Change back to dispatch | ||
on: | ||
[push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
bench: | ||
name: Bench ${{matrix.os}} | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
# VERSION/DIAGNOSTICS | ||
|
||
- if: matrix.os == 'ubuntu-latest' | ||
name: Get Linux CPU Info | ||
run: cat /proc/cpuinfo | ||
shell: bash | ||
|
||
- if: matrix.os == 'macos-latest' | ||
name: Get macOS CPU Info | ||
run: sysctl -a | grep cpu | ||
shell: bash | ||
|
||
- if: matrix.os == 'windows-latest' | ||
name: Get Windows CPU Info | ||
run: wmic cpu list /format:list | ||
shell: bash | ||
|
||
- run: cargo --version | ||
- run: cmake --version | ||
|
||
# RUST | ||
|
||
- run: | | ||
cd extras/simple-bench | ||
cargo build --release | ||
name: Build Rust | ||
- run: | | ||
cd extras/simple-bench | ||
cargo run --release -- file ext/data/canada.txt | ||
cargo run --release -- file ext/data/mesh.txt | ||
cargo run --release -- random uniform | ||
cargo run --release -- random one_over_rand32 | ||
cargo run --release -- random simple_uniform32 | ||
cargo run --release -- random simple_int32 | ||
cargo run --release -- random simple_int64 | ||
cargo run --release -- random int_e_int | ||
cargo run --release -- random int_e_int | ||
cargo run --release -- random bigint_int_dot_int | ||
cargo run --release -- random big_ints | ||
name: Bench Rust | ||
shell: bash | ||
# C++ | ||
|
||
- run: | | ||
cd extras/simple-bench/ext | ||
cmake -DCMAKE_BUILD_TYPE=Release -B build . | ||
cmake --build build --config Release | ||
name: Build C/C++ | ||
- run: | | ||
cd extras/simple-bench/ext | ||
if [[ -f build/benchmarks/Release/benchmark.exe ]]; then | ||
exe=build/benchmarks/Release/benchmark.exe | ||
else | ||
exe=build/benchmarks/benchmark | ||
fi | ||
"${exe}" -f data/canada.txt | ||
"${exe}" -f data/mesh.txt | ||
"${exe}" -m uniform | ||
"${exe}" -m one_over_rand32 | ||
"${exe}" -m simple_uniform32 | ||
"${exe}" -m simple_int32 | ||
"${exe}" -m simple_int64 | ||
"${exe}" -m int_e_int | ||
"${exe}" -m bigint_int_dot_int | ||
"${exe}" -m big_ints | ||
name: Bench C/C++ | ||
shell: bash |
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
Submodule ext
updated
16 files
+26 −0 | .github/workflows/ubuntu.yml | |
+24 −0 | .github/workflows/vs.yml | |
+20 −0 | .gitignore | |
+48 −21 | CMakeLists.txt | |
+2 −2 | README.md | |
+17 −3 | benchmarks/CMakeLists.txt | |
+1,117 −0 | benchmarks/apple_arm_events.h | |
+162 −76 | benchmarks/benchmark.cpp | |
+107 −24 | benchmarks/benchmark32.cpp | |
+46 −45 | benchmarks/event_counter.h | |
+11 −9 | benchmarks/linux-perf-events.h | |
+2 −2 | benchmarks/random_generators.h | |
+1 −0 | benchmarks/to_chars.cpp | |
+111,126 −0 | data/canada_short.txt | |
+27 −0 | data/contrived.txt | |
+2 −2 | run_bench.sh |