Merge pull request #85 from Niema-Lab/dependabot/npm_and_yarn/playwri… #83
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: benchmarks | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ['master'] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
benchmark: | |
timeout-minutes: 240 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install site benchmark dependencies | |
run: npm ci | |
- name: Build site for Playwright and get ref genome data | |
env: | |
VITE_OFFLINE_VERSION: true | |
run: npm run build | |
- name: Setup cli benchmark dependencies | |
run: | | |
cd e2e/tests/ | |
bash setup-baseline-benchmarks.sh | |
- name: Download data for benchmarks | |
run: | | |
cd e2e/tests/ | |
bash download-benchmark-data.sh | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV | |
- name: Cache Playwright binaries | |
uses: actions/cache@v3 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- run: npx playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- run: npx playwright install-deps | |
if: steps.playwright-cache.outputs.cache-hit == 'true' | |
- name: Run Playwright benchmark tests | |
run: npx playwright test site-benchmarks.spec.ts | |
- name: Run cli benchmark tests | |
run: | | |
cd e2e/tests/ | |
bash run-baseline-benchmarks.sh | |
- name: Run benchmark summary script | |
run: | | |
cd e2e/tests/ | |
bash benchmark-summary.sh | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: benchmarks | |
path: benchmarks/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: benchmark-run-outputs | |
path: benchmark-run-outputs/ |