Skip to content
Merged
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
116 changes: 116 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
permissions:
actions: read
contents: write
pull-requests: write

Expand All @@ -33,6 +34,34 @@ jobs:
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --no-fund

- name: Download native addon from Publish
if: github.event_name == 'workflow_run'
uses: actions/download-artifact@v4
with:
name: native-linux-x64
path: ${{ runner.temp }}/native-artifact
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Install native addon from Publish
if: github.event_name == 'workflow_run'
run: |
ARTIFACT_DIR="${{ runner.temp }}/native-artifact"
NODE_FILE="$ARTIFACT_DIR/codegraph-core.node"
if [ ! -f "$NODE_FILE" ]; then
echo "::error::Native addon not found at $NODE_FILE"
ls -la "$ARTIFACT_DIR" || true
exit 1
fi
PKG_DIR="node_modules/@optave/codegraph-linux-x64-gnu"
mkdir -p "$PKG_DIR"
cp "$NODE_FILE" "$PKG_DIR/codegraph-core.node"
if [ ! -f "$PKG_DIR/package.json" ]; then
echo '{"name":"@optave/codegraph-linux-x64-gnu","main":"codegraph-core.node"}' > "$PKG_DIR/package.json"
fi
echo "Installed native addon from Publish workflow run ${{ github.event.workflow_run.id }}"
echo " sha256: $(sha256sum "$PKG_DIR/codegraph-core.node" | cut -d' ' -f1)"

- name: Run build benchmark
run: node scripts/benchmark.js 2>/dev/null > benchmark-result.json

Expand Down Expand Up @@ -85,6 +114,7 @@ jobs:
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
permissions:
actions: read
contents: write
pull-requests: write

Expand All @@ -103,6 +133,34 @@ jobs:
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --no-fund

- name: Download native addon from Publish
if: github.event_name == 'workflow_run'
uses: actions/download-artifact@v4
with:
name: native-linux-x64
path: ${{ runner.temp }}/native-artifact
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Install native addon from Publish
if: github.event_name == 'workflow_run'
run: |
ARTIFACT_DIR="${{ runner.temp }}/native-artifact"
NODE_FILE="$ARTIFACT_DIR/codegraph-core.node"
if [ ! -f "$NODE_FILE" ]; then
echo "::error::Native addon not found at $NODE_FILE"
ls -la "$ARTIFACT_DIR" || true
exit 1
fi
PKG_DIR="node_modules/@optave/codegraph-linux-x64-gnu"
mkdir -p "$PKG_DIR"
cp "$NODE_FILE" "$PKG_DIR/codegraph-core.node"
if [ ! -f "$PKG_DIR/package.json" ]; then
echo '{"name":"@optave/codegraph-linux-x64-gnu","main":"codegraph-core.node"}' > "$PKG_DIR/package.json"
fi
echo "Installed native addon from Publish workflow run ${{ github.event.workflow_run.id }}"
echo " sha256: $(sha256sum "$PKG_DIR/codegraph-core.node" | cut -d' ' -f1)"

- name: Cache HuggingFace models
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -167,6 +225,7 @@ jobs:
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
permissions:
actions: read
contents: write
pull-requests: write

Expand All @@ -185,6 +244,34 @@ jobs:
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --no-fund

- name: Download native addon from Publish
if: github.event_name == 'workflow_run'
uses: actions/download-artifact@v4
with:
name: native-linux-x64
path: ${{ runner.temp }}/native-artifact
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Install native addon from Publish
if: github.event_name == 'workflow_run'
run: |
ARTIFACT_DIR="${{ runner.temp }}/native-artifact"
NODE_FILE="$ARTIFACT_DIR/codegraph-core.node"
if [ ! -f "$NODE_FILE" ]; then
echo "::error::Native addon not found at $NODE_FILE"
ls -la "$ARTIFACT_DIR" || true
exit 1
fi
PKG_DIR="node_modules/@optave/codegraph-linux-x64-gnu"
mkdir -p "$PKG_DIR"
cp "$NODE_FILE" "$PKG_DIR/codegraph-core.node"
if [ ! -f "$PKG_DIR/package.json" ]; then
echo '{"name":"@optave/codegraph-linux-x64-gnu","main":"codegraph-core.node"}' > "$PKG_DIR/package.json"
fi
echo "Installed native addon from Publish workflow run ${{ github.event.workflow_run.id }}"
echo " sha256: $(sha256sum "$PKG_DIR/codegraph-core.node" | cut -d' ' -f1)"

- name: Run query benchmark
run: node scripts/query-benchmark.js 2>/dev/null > query-benchmark-result.json

Expand Down Expand Up @@ -237,6 +324,7 @@ jobs:
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
permissions:
actions: read
contents: write
pull-requests: write

Expand All @@ -255,6 +343,34 @@ jobs:
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --no-fund

- name: Download native addon from Publish
if: github.event_name == 'workflow_run'
uses: actions/download-artifact@v4
with:
name: native-linux-x64
path: ${{ runner.temp }}/native-artifact
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Install native addon from Publish
if: github.event_name == 'workflow_run'
run: |
ARTIFACT_DIR="${{ runner.temp }}/native-artifact"
NODE_FILE="$ARTIFACT_DIR/codegraph-core.node"
if [ ! -f "$NODE_FILE" ]; then
echo "::error::Native addon not found at $NODE_FILE"
ls -la "$ARTIFACT_DIR" || true
exit 1
fi
PKG_DIR="node_modules/@optave/codegraph-linux-x64-gnu"
mkdir -p "$PKG_DIR"
cp "$NODE_FILE" "$PKG_DIR/codegraph-core.node"
if [ ! -f "$PKG_DIR/package.json" ]; then
echo '{"name":"@optave/codegraph-linux-x64-gnu","main":"codegraph-core.node"}' > "$PKG_DIR/package.json"
fi
echo "Installed native addon from Publish workflow run ${{ github.event.workflow_run.id }}"
echo " sha256: $(sha256sum "$PKG_DIR/codegraph-core.node" | cut -d' ' -f1)"

- name: Run incremental benchmark
run: node scripts/incremental-benchmark.js 2>/dev/null > incremental-benchmark-result.json

Expand Down