Skip to content

Run benchmarks

Run benchmarks #2925

Workflow file for this run

name: Run benchmarks
on:
schedule:
- cron: 9 0,6,12,18 * * *
push:
workflow_dispatch:
env:
PROFILE: /tmp/.benchmarksprofile
jobs:
run:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
# Because gh actions includes node by default :(
- name: Install node
uses: actions/setup-node@v3
with:
node-version: current
- name: Install bun
uses: xhyrom/setup-bun@v0.1.8
with:
bun-version: latest
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: rm -rf node_modules/ && npm install && bun install
- name: Run setup
run: |
bun run setup:init
bun install
bun run setup:languages
bun install
source $PROFILE
bun install
bun run setup:benchmarks
- name: Run benchmarks
run: |
source $PROFILE
bun run bench
- name: Generate website
run: |
source $PROFILE
cd website/ && deno task build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./website/_site
- name: Set timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
- name: Get the current branch name
shell: bash
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
id: branch
- name: Push changes
uses: actions-js/push@master
with:
github_token: '${{ secrets.ACCESS_TOKEN }}'
branch: ${{ steps.branch.outputs.branch }}
#author_email: 41898282+github-actions[bot]@users.noreply.github.com
#author_name: github-actions[bot]
message: Update benchmarks ${{ env.timestamp }} πŸš€
deploy:
# Add a dependency to the build job
needs: run
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1