fluid-let 1.0.0

Dynamically scoped variables
Documentation
name: Benchmarks

on:
  pull_request:
    branches:
    - master

env:
  # Treat warnings as errors
  RUSTFLAGS: -D warnings

jobs:
  benchmark:
    # Benchmarks can be really flaky in CI environment, so we're using them mostly
    # to ensure that 1) they are compilable, and 2) there no drastic unexpected
    # degradation in performance. They also take quite a long time to run, so it's
    # okay to run them in only one environment.
    runs-on: ubuntu-latest
    steps:
    - name: Set up Rust toolchain
      uses: actions-rs/toolchain@v1
      with:
        toolchain: stable
    - name: Set up gnuplot
      run: sudo apt-get update && sudo apt-get install gnuplot

    - name: Check out old code
      uses: actions/checkout@v1
      with:
        ref: ${{ github.base_ref }}
    - name: Compile benchmarks
      run: cd benches && cargo bench --no-run
    - name: Run benchmarks for old code
      run: cd benches && cargo bench

    - name: Check out new code
      uses: actions/checkout@v1
      with:
        clean: false
        ref: ${{ github.head_ref }}
    - name: Compile benchmarks
      run: cd benches && cargo bench --no-run
    - name: Run benchmarks for new code
      run: cd benches && cargo bench

    - name: Upload benchmark comparison
      uses: actions/upload-artifact@v1
      with:
        name: Benchmark report
        path: benches/target/criterion

    # Since benchmarks are in a separate crate, these checks are not performed
    # by the main workflow. Do them here to ensure quality of benchmarks.
    - name: Check code formatting
      run: cd benches && cargo fmt -- --check
    - name: Run static analysis on tests
      run: cd benches && cargo clippy --all-targets