perf: Add benchmarks for BtreeMap::Iterator::count() #588
Workflow file for this run
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
name: CI | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: [ 1.76.0 ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Cargo | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ matrix.build }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ matrix.build }}-cargo- | |
- name: Install Rust | |
run: | | |
rustup update ${{ matrix.rust }} --no-self-update | |
rustup default ${{ matrix.rust }} | |
rustup component add rustfmt | |
rustup component add clippy | |
- name: Check Format | |
run: cargo fmt --all -- --check | |
- name: Clippy | |
run: cargo clippy --tests --benches -- -D clippy::all | |
- name: Test | |
run: cargo test | |
env: | |
RUST_BACKTRACE: 1 | |
examples: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1 | |
- name: Install Rust | |
run: | | |
rustup update ${{ matrix.rust }} --no-self-update | |
rustup default ${{ matrix.rust }} | |
rustup target add wasm32-unknown-unknown | |
- name: Install DFX | |
run: | | |
wget --output-document install-dfx.sh "https://internetcomputer.org/install.sh" | |
DFX_VERSION=${DFX_VERSION:=0.14.3} bash install-dfx.sh < <(yes Y) | |
rm install-dfx.sh | |
dfx cache install | |
echo "$HOME/bin" >> $GITHUB_PATH | |
- name: Run test | |
run: | | |
bash examples/test.sh | |
benchmark: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1 | |
- name: Install Rust | |
run: | | |
rustup update ${{ matrix.rust }} --no-self-update | |
rustup default ${{ matrix.rust }} | |
rustup target add wasm32-unknown-unknown | |
- name: Run benchmark test | |
run: | | |
bash .github/workflows/benchmark_ci.sh | |
checks-pass: | |
# Always run this job! | |
if: always() | |
needs: [build, examples, benchmark] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: check build result | |
if: ${{ needs.build.result != 'success' }} | |
run: exit 1 | |
- name: check examples result | |
if: ${{ needs.examples.result != 'success' }} | |
run: exit 1 | |
- name: check benchmark result | |
if: ${{ needs.benchmark.result != 'success' }} | |
run: exit 1 |