Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 70 additions & 17 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ concurrency:
jobs:
detect-changes:
name: "Detect Changes"
runs-on: blacksmith-8vcpu-ubuntu-2404-arm
runs-on: ubuntu-24.04-arm
outputs:
app_only: ${{ steps.check.outputs.app_only }}
steps:
Expand Down Expand Up @@ -78,10 +78,51 @@ jobs:
echo "app_only=$APP_ONLY" >> "$GITHUB_OUTPUT"
echo "App-only changes: $APP_ONLY"

setup:
name: "Setup Environment"
runs-on: ubuntu-24.04-arm
needs: [detect-changes]
if: needs.detect-changes.outputs.app_only != 'true'
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install Node
uses: actions/setup-node@v6
with:
node-version: '24'
package-manager-cache: false
- name: Install & Setup Tools
run: bash ./scripts/setup.sh
- name: Package tools
run: |
PREFIX=$(npm config get prefix)
echo "npm prefix: $PREFIX"
tar czf /tmp/bench-tools.tar.gz \
"$PREFIX/lib/node_modules" \
"$PREFIX/bin" \
/usr/bin/hyperfine \
~/.yarn \
~/.cache/node/corepack \
~/.npmrc \
./results/versions.json
echo "Archive size: $(du -h /tmp/bench-tools.tar.gz | cut -f1)"
- name: Upload Tools
uses: actions/upload-artifact@v7
with:
name: bench-tools
path: /tmp/bench-tools.tar.gz
retention-days: 1
- name: Upload Versions Info
uses: actions/upload-artifact@v7
with:
name: versions-info
path: ./results/versions.json
retention-days: 7

benchmark:
name: "Run Benchmarks"
runs-on: blacksmith-8vcpu-ubuntu-2404-arm
needs: [detect-changes]
runs-on: ubuntu-24.04-arm
needs: [detect-changes, setup]
if: needs.detect-changes.outputs.app_only != 'true'
timeout-minutes: 45
strategy:
Expand All @@ -106,9 +147,19 @@ jobs:
with:
node-version: '24'
package-manager-cache: false
- name: Install & Setup Tools
- name: Download tools
uses: actions/download-artifact@v8
with:
name: bench-tools
path: /tmp/bench-tools
- name: Restore tools
run: |
bash ./scripts/setup.sh
sudo tar xzf /tmp/bench-tools/bench-tools.tar.gz -C /
echo "$HOME/.yarn/switch/bin" >> "$GITHUB_PATH"
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y jq strace unzip
mkdir -p ./results/
- name: Configure AWS Credentials
if: startsWith(matrix.variation, 'registry-')
uses: aws-actions/configure-aws-credentials@v6
Expand Down Expand Up @@ -163,15 +214,10 @@ jobs:
name: results-${{ matrix.fixture }}-${{ matrix.variation }}
path: ./results/${{ matrix.fixture }}/${{ matrix.variation }}/
retention-days: 7
- name: Upload Versions Info
uses: actions/upload-artifact@v7
with:
name: versions-${{ matrix.fixture }}-${{ matrix.variation }}
path: ./results/versions.json
retention-days: 7

process:
name: "Process Results"
runs-on: blacksmith-8vcpu-ubuntu-2404-arm
runs-on: ubuntu-24.04-arm
needs: [detect-changes, benchmark]
if: needs.detect-changes.outputs.app_only != 'true'
timeout-minutes: 5
Expand All @@ -181,6 +227,15 @@ jobs:
uses: actions/setup-node@v6
with:
node-version: "24"
- name: Download tools
uses: actions/download-artifact@v8
with:
name: bench-tools
path: /tmp/bench-tools
- name: Restore tools
run: sudo tar xzf /tmp/bench-tools/bench-tools.tar.gz -C /
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y jq
- name: Download Results
uses: actions/download-artifact@v8
with:
Expand All @@ -194,9 +249,6 @@ jobs:
- name: Process Results
run: |
./bench process
- name: Install vlt
run: |
npm install -g vlt@latest
- name: Build Charts View
run: |
pushd app
Expand All @@ -209,9 +261,10 @@ jobs:
name: results
path: results/
retention-days: 7

deploy:
name: "Deploy Results"
runs-on: blacksmith-8vcpu-ubuntu-2404-arm
runs-on: ubuntu-24.04-arm
needs: [detect-changes, process]
permissions:
contents: write
Expand All @@ -232,7 +285,7 @@ jobs:

deploy-app:
name: "Deploy App Only"
runs-on: blacksmith-8vcpu-ubuntu-2404-arm
runs-on: ubuntu-24.04-arm
needs: [detect-changes]
permissions:
contents: write
Expand Down
43 changes: 43 additions & 0 deletions scripts/log-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

set -e

mkdir -p ./results

NPM_VERSION="$(npm -v)"
VLT_VERSION="$(vlt -v)"
YARN_VERSION="$(corepack yarn@1 -v)"
BERRY_VERSION="$(corepack yarn@latest -v)"
ZPM_VERSION="$(curl -s https://repo.yarnpkg.com/channels/default/canary)"
PNPM_VERSION="$(corepack pnpm@latest -v)"
BUN_VERSION="$(bun -v)"
DENO_VERSION="$(npm view deno@latest version)"
NX_VERSION="$(npm view nx@latest version)"
TURBO_VERSION="$(npm view turbo@latest version)"
NODE_VERSION=$(node -v)

echo "npm: $NPM_VERSION"
echo "vlt: $VLT_VERSION"
echo "yarn: $YARN_VERSION"
echo "yarn (berry): $BERRY_VERSION"
echo "yarn (zpm): $ZPM_VERSION"
echo "pnpm: $PNPM_VERSION"
echo "bun: $BUN_VERSION"
echo "deno: $DENO_VERSION"
echo "nx: $NX_VERSION"
echo "turbo: $TURBO_VERSION"
echo "node: $NODE_VERSION"

echo "{
\"npm\": \"$NPM_VERSION\",
\"vlt\": \"$VLT_VERSION\",
\"yarn\": \"$YARN_VERSION\",
\"berry\": \"$BERRY_VERSION\",
\"zpm\": \"$ZPM_VERSION\",
\"pnpm\": \"$PNPM_VERSION\",
\"bun\": \"$BUN_VERSION\",
\"deno\": \"$DENO_VERSION\",
\"nx\": \"$NX_VERSION\",
\"turbo\": \"$TURBO_VERSION\",
\"node\": \"$NODE_VERSION\"
}" > ./results/versions.json
40 changes: 1 addition & 39 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,44 +53,6 @@ mkdir -p ./results/

# Log Package Manager Versions
echo "Logging package manager versions..."
NPM_VERSION="$(npm -v)"
VLT_VERSION="$(vlt -v)"
YARN_VERSION="$(corepack yarn@1 -v)"
BERRY_VERSION="$(corepack yarn@latest -v)"
ZPM_VERSION="$(curl https://repo.yarnpkg.com/channels/default/canary)"
PNPM_VERSION="$(corepack pnpm@latest -v)"
BUN_VERSION="$(bun -v)"
DENO_VERSION="$(npm view deno@latest version)"
NX_VERSION="$(npm view nx@latest version)"
TURBO_VERSION="$(npm view turbo@latest version)"
NODE_VERSION=$(node -v)

# Output versions
echo "npm: $NPM_VERSION"
echo "vlt: $VLT_VERSION"
echo "yarn: $YARN_VERSION"
echo "yarn (berry): $BERRY_VERSION"
echo "yarn (zpm): $ZPM_VERSION"
echo "pnpm: $PNPM_VERSION"
echo "bun: $BUN_VERSION"
echo "deno: $DENO_VERSION"
echo "nx: $NX_VERSION"
echo "turbo: $TURBO_VERSION"
echo "node: $NODE_VERSION"

# Save versions to JSON file
echo "{
\"npm\": \"$NPM_VERSION\",
\"vlt\": \"$VLT_VERSION\",
\"yarn\": \"$YARN_VERSION\",
\"berry\": \"$BERRY_VERSION\",
\"zpm\": \"$ZPM_VERSION\",
\"pnpm\": \"$PNPM_VERSION\",
\"bun\": \"$BUN_VERSION\",
\"deno\": \"$DENO_VERSION\",
\"nx\": \"$NX_VERSION\",
\"turbo\": \"$TURBO_VERSION\",
\"node\": \"$NODE_VERSION\"
}" > ./results/versions.json
bash "$(dirname "$0")/log-versions.sh"

echo "Setup completed successfully!"
Loading