Skip to content

Add swap space action #16

Add swap space action

Add swap space action #16

Workflow file for this run

name: CodSpeed
on:
push:
branches:
- "main"
- "codspeed"
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:
jobs:
codspeed:
name: Run benchmarks
runs-on: warp-ubuntu-latest-x64-32x
env:
# Set features for the Makefile
FEATURES: ${{ matrix.features }}
RUSTFLAGS: "-Awarnings"
strategy:
matrix:
toolchain:
- stable
features:
- ""
steps:
- uses: actions/checkout@v4
- name: Setup rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
- name: Download builder playground
uses: flashbots/[email protected]
with:
builder-playground: v0.1.3
# https://github.com/swatinem/rust-cache
- name: Run Swatinem/rust-cache@v2
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
# https://github.com/Mozilla-Actions/sccache-action
- name: Run sccache-action
uses: mozilla-actions/[email protected]
- name: Set sccache env vars
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Build the rbuilder
run: cargo build --features="${{ matrix.features }}"
- name: Run the playground
run: builder-playground &
- name: Install codspeed
run: cargo install cargo-codspeed
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 64
- name: Build the benchmark target(s)
run: cargo codspeed build --package rbuilder
- name: Run the benchmarks
uses: CodSpeedHQ/action@v3
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}