Remove a lot of pop().unwrap() #10280
This file contains hidden or 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
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '**.rs' | |
| - '**/Cargo.toml' | |
| - '**/Cargo.lock' | |
| - '**/rust-toolchain.toml' | |
| - .github/workflows/cargo-bench.yml | |
| pull_request: | |
| paths: | |
| - '**.rs' | |
| - '**/Cargo.toml' | |
| - '**/Cargo.lock' | |
| - '**/rust-toolchain.toml' | |
| - .github/workflows/cargo-bench.yml | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| name: cargo bench | |
| jobs: | |
| cargo-bench: | |
| name: cargo bench | |
| runs-on: ubuntu-latest | |
| # runs-on: namespace-profile-ubuntu-2-cores | |
| # TODO: Figure out if there is a way to make CodSpeed work with Namespace | |
| # Enabling this results in the following error on GitHub Actions: | |
| # setarch: failed to set personality to x86_64: Operation not permitted | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Use correct Rust toolchain | |
| shell: bash | |
| run: | | |
| [ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./ | |
| - name: Install rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache: rust | |
| - name: Install dependencies | |
| run: | | |
| cargo install cargo-criterion | |
| cargo install cargo-codspeed | |
| cd rust/kcl-lib | |
| cargo add --dev codspeed-criterion-compat --rename criterion | |
| - name: Build the benchmark target(s) | |
| run: | | |
| cd rust | |
| cargo codspeed build | |
| - name: Run the benchmarks | |
| uses: CodSpeedHQ/action@v3 | |
| with: | |
| working-directory: rust | |
| run: cargo codspeed run | |
| token: ${{ secrets.CODSPEED_TOKEN }} | |
| env: | |
| ZOO_API_TOKEN: ${{ secrets.ZOO_API_TOKEN }} |