Skip to content

Commit

Permalink
Workflow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Mar 15, 2024
1 parent 1abb69a commit d879ed8
Showing 1 changed file with 53 additions and 12 deletions.
65 changes: 53 additions & 12 deletions .github/workflows/run-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,50 +63,91 @@ jobs:
with:
name: bench-environment
- name: Move tarballs from env to correct location
working-directory: benchmarks
run: |
ls -al
mv preact-local.tgz dependencies/preact/local-pinned/preact-local-pinned.tgz
ls -al dependencies/preact/local-pinned
mv preact-main.tgz dependencies/preact/main/preact-main.tgz
ls -al dependencies/preact/main
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: benchmarks
run: pnpm install
# Set the CHROMEDRIVER_FILEPATH so the chromedriver npm package uses the
# correct binary when its installed
run: |
export CHROMEDRIVER_FILEPATH=$(which chromedriver)
pnpm install --reporter ndjson > pnpm-log-0.json
# Install local dependencies with --no-frozen-lockfile to ensure local tarballs
# are installed regardless of if they match the integrity hash stored in the lockfile
pnpm install --no-frozen-lockfile --filter ./dependencies --reporter ndjson > pnpm-log-1.json
- name: List dependency directories
working-directory: benchmarks
run: |
echo
echo "$ ls -al dependencies/preact/local-pinned"
ls -al dependencies/preact/local-pinned
echo
echo "$ ls -al dependencies/preact/local-pinned/node_modules"
ls -al dependencies/preact/local-pinned/node_modules
echo "$ ls -al node_modules/.pnpm/tachometer@*/node_modules/tachometer/node_modules"
ls -al node_modules/.pnpm/tachometer@*/node_modules/tachometer/node_modules
echo
echo "$ ls -a dependencies/preact/local-pinned/node_modules/preact"
ls -a dependencies/preact/local-pinned/node_modules/preact
# DEBUGGING
# - name: Tar working dir
# run: |
# tar -z -c -f benchmarks.tgz --exclude .git benchmarks
# - name: Upload working dir
# uses: actions/upload-artifact@v3
# with:
# name: benchmarks
# path: benchmarks.tgz
- name: DEBUG require preact
working-directory: benchmarks
run: |
cd dependencies/preact/local-pinned
node -e "console.log(require.resolve('preact'))"
# Run benchmark
- name: Run benchmark
working-directory: benchmarks
run: |
export CHROMEDRIVER_FILEPATH=$(which chromedriver)
pnpm run bench apps/${{ inputs.benchmark }}.html -d preact@local-pinned -d preact@main --trace=${{ inputs.trace }}
pnpm run bench apps/${{ inputs.benchmark }}.html -d preact@local-pinned -d preact@main --trace=${{ inputs.trace }} -t 0
# 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"'
run: |
if [ -d out/logs ]; then
LOGS_FILE=out/${{ inputs.benchmark }}_logs.tgz
mkdir -p out/$(dirname $LOGS_FILE)
tar -zcvf $LOGS_FILE out/logs
else
echo "No logs found"
fi
# Upload results and logs
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: results
path: benchmarks/results/${{ inputs.benchmark }}.json
path: benchmarks/out/results/${{ inputs.benchmark }}.json
- name: Upload logs
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.benchmark}}_logs
path: benchmarks/out/${{ inputs.benchmark}}_logs.tgz
path: benchmarks/out/${{ inputs.benchmark }}_logs.tgz
if-no-files-found: ignore

# DEBUGGING
- name: Tar working dir
run: |
tar -z -c -f benchmarks.tgz --exclude .git benchmarks
- name: Upload working dir
uses: actions/upload-artifact@v3
with:
name: benchmarks
path: benchmarks.tgz

0 comments on commit d879ed8

Please sign in to comment.