From e0ae0bdd3c9f505ddf62d04b8bd4e3649444c63e Mon Sep 17 00:00:00 2001 From: Sophie Dankel <47993817+sdankel@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:23:23 -0800 Subject: [PATCH] Run LSP benchmarks in CI (#5546) ## Description Runs benchmarks in CI with [criterion-compare-prs](https://github.com/marketplace/actions/criterion-compare-prs) so the comparison shows as a comment on the PR. The extra config in `Cargo.toml` is because of this issue: https://github.com/bheisler/criterion.rs/issues/275. It needs to be merged to master first (https://github.com/FuelLabs/sway/pull/5547) for the benchmark comparison to work. ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers. --- .github/workflows/bench-lsp.yml | 26 ++++++++++++++++++++++++++ sway-lsp/README.md | 1 - 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/bench-lsp.yml diff --git a/.github/workflows/bench-lsp.yml b/.github/workflows/bench-lsp.yml new file mode 100644 index 00000000000..64b2d46e9bc --- /dev/null +++ b/.github/workflows/bench-lsp.yml @@ -0,0 +1,26 @@ +name: Benchmark LSP + +on: + pull_request: + draft: false + paths: + - forc-plugins/forc-lsp/** + - sway-lsp/** + - forc-pkg/** + - sway-core/** + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + compare-master: + runs-on: ubuntu-latest + steps: + - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@v3 + - uses: boa-dev/criterion-compare-action@v3.2.4 + with: + cwd: "./sway-lsp" + branchName: ${{ github.base_ref }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/sway-lsp/README.md b/sway-lsp/README.md index 13ee647eee8..8225e90e8f1 100644 --- a/sway-lsp/README.md +++ b/sway-lsp/README.md @@ -16,7 +16,6 @@ This extension provides LSP support for the Sway smart contract programming lang - code actions - imports insertion - _Coming Soon_ - code completion - apply suggestions from errors