test: add tinybench benchmarks and CodSpeed CI #3
Workflow file for this run
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: CodSpeed | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # Allow manual runs from the Actions tab. | |
| workflow_dispatch: | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| jobs: | |
| benchmarks: | |
| name: Run benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: lts/* | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run benchmarks and upload to CodSpeed | |
| uses: CodSpeedHQ/action@v3 | |
| with: | |
| # Run all benchmark files. CodSpeed instruments them automatically | |
| # via @codspeed/tinybench-plugin, which is wired up in benchmarks/helpers.js. | |
| run: npm run bench | |
| token: ${{ secrets.CODSPEED_TOKEN }} |