{"schema":"decodex/commit/1","summary":"Land vstyle performance telem… #33
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
| name: Benchmarks | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
| CARGO_TERM_COLOR: always | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 3 * * 1' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/benchmark.yml' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - 'Makefile.toml' | |
| - 'scripts/bench-*.sh' | |
| - 'src/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name != 'schedule' }} | |
| jobs: | |
| benchmark: | |
| name: ${{ matrix.name }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - key: release | |
| name: Release benchmark | |
| task: bench-release-vstyle | |
| summary_glob: target/vstyle-bench/*/summary.txt | |
| artifact_path: target/vstyle-bench | |
| - key: semantic | |
| name: Semantic benchmark | |
| task: bench-semantic-vstyle | |
| summary_glob: target/vstyle-bench-semantic/*/summary.txt | |
| artifact_path: target/vstyle-bench-semantic | |
| steps: | |
| - name: Fetch latest code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 | |
| with: | |
| cache: true | |
| rustflags: '' | |
| - name: Install cargo-make | |
| uses: taiki-e/install-action@16b05812d776ae1dfaabc8277e421fb6d2506419 # v2.82.7 | |
| with: | |
| tool: cargo-make | |
| - name: Run benchmark | |
| run: cargo make ${{ matrix.task }} | |
| - name: Publish benchmark summary | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| summary_file="$(find . -path "./${{ matrix.summary_glob }}" -type f | sort | tail -n 1)" | |
| if [[ -z "${summary_file}" ]]; then | |
| printf 'Missing summary file for %s\n' "${{ matrix.name }}" >&2 | |
| exit 1 | |
| fi | |
| { | |
| printf "## %s\n\n" "${{ matrix.name }}" | |
| printf "Summary file: \`%s\`\n\n" "${summary_file#./}" | |
| printf "%s\n" '```text' | |
| cat "${summary_file}" | |
| printf "%s\n" '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload benchmark artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: benchmarks-${{ matrix.key }}-${{ github.run_number }}-${{ github.run_attempt }} | |
| path: ${{ matrix.artifact_path }} | |
| if-no-files-found: error | |
| retention-days: 14 |