-
Notifications
You must be signed in to change notification settings - Fork 134
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 #2153 from infogulch/benchmark
Add benchmarks
- Loading branch information
Showing
15 changed files
with
827 additions
and
79 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,52 @@ | ||
name: 'Setup Rust' | ||
inputs: | ||
rust-version: | ||
required: true | ||
type: string | ||
targets: | ||
required: true | ||
type: string | ||
components: | ||
required: false | ||
default: | ||
cache-context: | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: dtolnay/rust-toolchain@master | ||
id: toolchain | ||
with: | ||
toolchain: ${{ inputs.rust-version }} | ||
targets: ${{ inputs.targets }} | ||
components: ${{ inputs.components }} | ||
|
||
- name: Install i686 dependencies | ||
if: "contains(inputs.targets,'i686')" | ||
shell: bash | ||
run: | | ||
sudo dpkg --add-architecture i386 | ||
sudo apt-get update | ||
sudo apt-get install libssl-dev:i386 gcc-multilib clang -y | ||
echo "CC=clang" >> $GITHUB_ENV | ||
echo "PKG_CONFIG_SYSROOT_DIR=/" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ inputs.cache-context }}_${{ inputs.targets }}_rustc-${{ steps.toolchain.outputs.cachekey }}_cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
# Remove build artifacts for the current crate, since it will be rebuilt every | ||
# run anyway, but keep dependency artifacts to cache them. | ||
# Must be placed after actions/cache so its post step runs first. | ||
- uses: pyTooling/Actions/with-post-step@v0.4.6 | ||
with: | ||
main: bash ./.github/actions/setup-rust/cleanup.sh | ||
post: bash ./.github/actions/setup-rust/cleanup.sh |
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,10 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
echo Cleanup workspace build artifacts and extra target output | ||
|
||
# clean just the direct members of the current workspace, with cargo metadata should generalize to all rust projects | ||
cargo clean -p `cargo metadata --format-version 1 | jq -r '[.workspace_members[]|split(" ")|.[0]]|join(" ")'` | ||
|
||
# remove directories in /target/ that are not named `debug` or `release` | ||
find ./target -maxdepth 1 -type d ! -name debug ! -name release ! -name target -exec rm -r {} \; |
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
Oops, something went wrong.