Skip to content

Commit

Permalink
Attempt to fix up workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Mar 7, 2024
1 parent 82c644c commit 39a4279
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 21 deletions.
59 changes: 47 additions & 12 deletions .github/workflows/run-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,71 @@ jobs:
timeout-minutes: ${{ inputs.timeout }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

# Setup pnpm
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# Install benchmark dependencies
- uses: actions/download-artifact@v3
with:
name: bench-environment
- name: Move tarballs from env to correct location
run: |
ls -al
mv preact-local.tgz benchmarks/dependencies/preact/local-pinned/preact-local-pinned.tgz
ls -al benchmarks/dependencies/preact/local-pinned
mv preact-main.tgz benchmarks/dependencies/preact/main/preact-main.tgz
ls -al benchmarks/dependencies/preact/main
- name: Install deps
working-directory: benches
run: npm ci
working-directory: benchmarks
run: pnpm install

# Run benchmark
- name: Run benchmark
working-directory: benches
working-directory: benchmarks
run: |
export CHROMEDRIVER_FILEPATH=$(which chromedriver)
npm run bench ${{ inputs.benchmark }}.html -- --trace=${{ inputs.trace }}
pnpm run bench ${{ inputs.benchmark }}.html -d preact@local-pinned -d preact@main --trace=${{ inputs.trace }}
# Prepare output
- name: Anaylze logs if present
working-directory: benchmarks
run: '[ -d out/logs ] && pnpm run analyze ${{ inputs.benchmark }} || echo "No logs to analyze"'
- name: Tar logs if present
working-directory: benchmarks
run: '[ -d out/logs ] && tar -zcvf out/${{ inputs.benchmark }}_logs.tgz out/logs || echo "No logs found"'

# Upload results and logs
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: results
path: benches/results/${{ inputs.benchmark }}.json
- name: Anaylze logs if present
working-directory: benches
run: '[ -d logs ] && npm run analyze ${{ inputs.benchmark }} || echo "No logs to analyze"'
- name: Tar logs if present
working-directory: benches
run: '[ -d logs ] && tar -zcvf ${{ inputs.benchmark}}_logs.tgz logs || echo "No logs found"'
path: benchmarks/results/${{ inputs.benchmark }}.json
- name: Upload logs
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.benchmark}}_logs
path: benches/${{ inputs.benchmark}}_logs.tgz
path: benchmarks/out/${{ inputs.benchmark}}_logs.tgz
if-no-files-found: ignore
16 changes: 8 additions & 8 deletions .github/workflows/single-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
description: 'Which benchmark to run'
type: choice
options:
- 02_replace1k
- 03_update10th1k_x16
- 07_create10k
- filter_list
- hydrate1k
- many_updates
- text_update
- todo
- table-app/replace1k
- table-app/update10th1k
- table-app/create10k
- table-app/hydrate1k
- filter_list/filter-list
- many-updates/many-updates
- text-update/text-update
- todo/todo
required: true
base:
description: 'The branch name, tag, or commit sha of the version of preact to benchmark against.'
Expand Down
2 changes: 1 addition & 1 deletion benchmarks

0 comments on commit 39a4279

Please sign in to comment.