refactor: node #227
This file contains 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: codspeed-benchmarks | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- main | |
# `workflow_dispatch` allows CodSpeed to trigger backtest | |
# performance analysis in order to generate initial data. | |
workflow_dispatch: | |
jobs: | |
call-rust-build: | |
uses: ./.github/workflows/rust-build.yaml | |
benchmarks: | |
needs: [call-rust-build] | |
runs-on: ${{ matrix.settings.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
settings: | |
- os: ubuntu-latest | |
abi: linux-x64-gnu | |
steps: | |
- uses: "actions/checkout@v3" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install Dependencies | |
run: npm install -g [email protected] && pnpm i --frozen-lockfile | |
- name: Build CLI and Core | |
run: pnpm --filter @farmfe/cli run build | |
- uses: actions/download-artifact@v3 | |
id: download | |
with: | |
name: ${{ github.sha }}-${{ matrix.settings.abi }} | |
path: ./packages/core/binding | |
- name: Build Core CJS | |
run: cd packages/core && pnpm run build:cjs | |
- name: Run benchmarks | |
uses: CodSpeedHQ/action@v3 | |
with: | |
run: npm exec vitest bench | |
token: ${{ secrets.CODSPEED_TOKEN }} |