From 7e432e9033f7fdc73c21bb363cf502c1d8085407 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Sun, 3 May 2026 16:44:02 +0200 Subject: [PATCH] chore: update ci workflow --- .gitea/workflows/benchmark.yaml | 42 +++++++++++++++++++++++++++------ .gitea/workflows/release.yaml | 3 ++- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/benchmark.yaml b/.gitea/workflows/benchmark.yaml index c965006..1ae30c4 100644 --- a/.gitea/workflows/benchmark.yaml +++ b/.gitea/workflows/benchmark.yaml @@ -14,7 +14,7 @@ env: jobs: release: runs-on: ubuntu-latest - container: git.max-richter.dev/max/nodarium-ci:bce06da456e3c008851ac006033cfff256015a47 + container: git.max-richter.dev/max/nodarium-ci:a56e8f445edb6064ae7a7b3b783fb7445f1b4e69 steps: - name: 📑 Checkout Code @@ -51,9 +51,37 @@ jobs: - name: 🏃 Execute Runtime run: pnpm run --filter @nodarium/app bench - - name: 📤 Upload Benchmark Results - uses: actions/upload-artifact@v3 - with: - name: benchmark-data - path: app/benchmark/out/ - compression: 9 + - name: 🔑 Setup SSH key + run: | + mkdir -p ~/.ssh + echo "${{ secrets.GIT_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + ssh-keyscan -p 2222 -H git.max-richter.dev >> ~/.ssh/known_hosts + + - name: 📤 Push Results + env: + BENCH_REPO: "git@git.max-richter.dev:max/nodarium-benchmarks.git" + run: | + git config --global user.name "nodarium-bot" + git config --global user.email "nodarium-bot@max-richter.dev" + + # 2. Clone the benchmarks repo into a temp folder + git config --global core.sshCommand "ssh -p 2222 -i ~/.ssh/id_ed25519 -o IdentitiesOnly=yes" + git clone git@git.max-richter.dev:max/nodarium-benchmarks.git target_bench_repo + + # 3. Create a directory structure based on the branch + # This allows the UI to "switch between branches" + SAFE_PR_NAME=$(printf "%s" "$GITHUB_HEAD_REF" | tr '/' '-') + DEST_DIR="target_bench_repo/data/$SAFE_PR_NAME/$(date +%s)" + mkdir -p "$DEST_DIR" + + # 4. Copy the new results + # Assuming your bench tool outputs a file named 'results.json' + cp app/benchmark/out/*.json "$DEST_DIR/" + + # 5. Commit and Push + cd target_bench_repo + git add . + git commit -m "Update benchmarks for $SAFE_PR_NAME: ${{ github.sha }}" + git push origin main + diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 67f75a6..fcbf18b 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -15,7 +15,7 @@ env: jobs: release: runs-on: ubuntu-latest - container: git.max-richter.dev/max/nodarium-ci:bce06da456e3c008851ac006033cfff256015a47 + container: git.max-richter.dev/max/nodarium-ci:a56e8f445edb6064ae7a7b3b783fb7445f1b4e69 steps: - name: 📑 Checkout Code @@ -81,3 +81,4 @@ jobs: SSH_HOST: ${{ vars.SSH_HOST }} SSH_PORT: ${{ vars.SSH_PORT }} SSH_USER: ${{ vars.SSH_USER }} +