Skip to content
Merged
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
62 changes: 59 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,69 @@ jobs:
make bench/pg
else
make bench/sqlite
fi | tee ../bench-${{ matrix.db }}.txt
fi
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/bench?sslmode=disable
DATABASE_DIRECT_URL: postgres://postgres:postgres@localhost:5432/bench?sslmode=disable
SKIP_DB_RESET: true

- uses: actions/upload-artifact@v4
- name: Upload Benchmark Artifact
uses: actions/upload-artifact@v4
with:
name: bench-${{ matrix.db }}-${{ github.sha }}
path: bench-${{ matrix.db }}.txt
path: benchmark/benchmarks.json

save-benchmarks:
name: Save Benchmark JSON
needs: benchmark
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Download SQLite Artifact
uses: actions/download-artifact@v4
with:
name: bench-sqlite-${{ github.sha }}
path: ./artifacts/sqlite

- name: Download Postgres Artifact
uses: actions/download-artifact@v4
with:
name: bench-postgres-${{ github.sha }}
path: ./artifacts/postgres

- name: Merge and Commit benchmarks.json
run: |
python3 -c "
import json, os, glob, datetime
target = 'benchmark/benchmarks.json'
report = json.load(open(target)) if os.path.exists(target) else {'updatedAt': '', 'domains': {}}
if 'domains' not in report:
report['domains'] = {}
for p in glob.glob('./artifacts/**/benchmarks.json', recursive=True):
if os.path.exists(p):
data = json.load(open(p))
for d_key, d_val in data.get('domains', {}).items():
if d_key not in report['domains']:
report['domains'][d_key] = d_val
else:
for db_key, db_val in d_val.get('databases', {}).items():
if 'databases' not in report['domains'][d_key]:
report['domains'][d_key]['databases'] = {}
report['domains'][d_key]['databases'][db_key] = db_val
report['updatedAt'] = datetime.datetime.now(datetime.timezone.utc).isoformat()
with open(target, 'w') as f:
json.dump(report, f, indent=2)
"
if [ -n "$(git status --porcelain benchmark/benchmarks.json)" ]; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add benchmark/benchmarks.json
git commit -m "chore(benchmark): update benchmark/benchmarks.json [skip ci]"
git push
else
echo "No benchmark results changed."
fi
41 changes: 41 additions & 0 deletions .github/workflows/sync-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Sync Documentation to Phi Website

on:
push:
branches: ["main", "master"]
paths:
- "docs/**"
workflow_dispatch:

jobs:
sync-docs:
name: Sync Docs to phi-website
runs-on: ubuntu-latest
steps:
- name: Checkout Valkyrie Docs
uses: actions/checkout@v4

- name: Checkout phi-website
uses: actions/checkout@v4
with:
repository: 'VoidClancy/phi-website'
token: ${{ secrets.DOCS_SYNC_TOKEN || secrets.GITHUB_TOKEN }}
path: 'phi-website'

- name: Copy docs to phi-website content/docs
run: |
mkdir -p phi-website/content/docs
cp -r docs/* phi-website/content/docs/

- name: Commit and Push Changes to phi-website
run: |
cd phi-website
if [ -n "$(git status --porcelain)" ]; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add content/docs/
git commit -m "docs: sync documentation from Valkyrie"
git push
else
echo "No documentation changes to sync."
fi
Loading
Loading