From 3232857c5153195ceae518daac72d295a75caef6 Mon Sep 17 00:00:00 2001 From: satyakwok Date: Thu, 7 May 2026 14:24:48 +0200 Subject: [PATCH 1/3] ci: add forge build/test + owner auto-merge + dependabot CI: forge build + forge test on PR/push, plus optional viem typecheck if scripts/ has its own npm package. Owner auto-merge: mirrors sentrix-labs/sentrix. Dependabot: monthly actions + weekly scripts/npm. --- .github/dependabot.yml | 12 +++++++ .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++ .github/workflows/owner-auto-merge.yml | 27 ++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/owner-auto-merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7688c79 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + + - package-ecosystem: "npm" + directory: "/scripts" + schedule: + interval: "weekly" + open-pull-requests-limit: 3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..16e1a58 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + pull_request: + branches: [main] + push: + branches: [main] + +permissions: + contents: read + +jobs: + contracts: + name: forge build + test + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v5 + with: + submodules: recursive + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: stable + + - name: forge build + run: forge build --sizes + + - name: forge test + run: forge test -vv + + - name: Setup Node 20 (for sentrix RPC scripts) + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: viem typecheck (script/) + run: | + if [ -f scripts/package.json ]; then + cd scripts && npm ci && npx tsc --noEmit + else + echo "no scripts/ npm package — skipping" + fi diff --git a/.github/workflows/owner-auto-merge.yml b/.github/workflows/owner-auto-merge.yml new file mode 100644 index 0000000..fe274ba --- /dev/null +++ b/.github/workflows/owner-auto-merge.yml @@ -0,0 +1,27 @@ +name: Owner auto-merge + +on: + pull_request_target: + types: [opened, reopened, synchronize, ready_for_review] + +permissions: + pull-requests: write + contents: write + +jobs: + enable-auto-merge: + runs-on: ubuntu-22.04 + if: > + github.event.pull_request.user.login == 'satyakwok' && + github.event.pull_request.draft == false + steps: + - name: Enable auto-merge (squash) for owner PR + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }} + run: | + set -e + gh pr merge --auto --squash "$PR_URL" || { + echo "::warning::auto-merge enable returned non-zero — PR may already be merged, conflicted, or have auto-merge already enabled." + exit 0 + } From cab6a4522ce83f370ebbf4c028acc9344b216ea0 Mon Sep 17 00:00:00 2001 From: satyakwok Date: Thu, 7 May 2026 14:57:34 +0200 Subject: [PATCH 2/3] ci: install forge deps via 'forge install' (lib/ not committed) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Repo's foundry.toml references openzeppelin-contracts + forge-std but lib/ is gitignored — the build env must fetch them at CI time via forge install. Without this, forge build errors with 'File not found'. --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16e1a58..cd1d207 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,18 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v5 - with: - submodules: recursive - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: version: stable + - name: Install forge dependencies + run: | + # Repo references openzeppelin-contracts + forge-std but lib/ is git-ignored. + # Install them via forge install. + forge install --no-commit OpenZeppelin/openzeppelin-contracts foundry-rs/forge-std + - name: forge build run: forge build --sizes From 34961572ac07183b57fc3ea8e579ac5724672a3c Mon Sep 17 00:00:00 2001 From: satyakwok Date: Thu, 7 May 2026 15:01:26 +0200 Subject: [PATCH 3/3] ci: drop --no-commit flag (newer forge versions removed it) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd1d207..99dfd53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: run: | # Repo references openzeppelin-contracts + forge-std but lib/ is git-ignored. # Install them via forge install. - forge install --no-commit OpenZeppelin/openzeppelin-contracts foundry-rs/forge-std + forge install OpenZeppelin/openzeppelin-contracts foundry-rs/forge-std - name: forge build run: forge build --sizes