Skip to content

chore: harden CI and run build + non-fork tests on push/PR - #433

Merged
kasperpawlowski merged 5 commits into
developmentfrom
chore/ci-hardening
Sep 1, 2026
Merged

kasperpawlowski merged 5 commits into
developmentfrom
chore/ci-hardening

Conversation

@kasperpawlowski

@kasperpawlowski kasperpawlowski commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Adds real CI to a repo that previously had none, plus workflow hardening. Now self-validated: this PR's own run is green — 437 non-fork tests pass, 0 failed, 0 skipped, across 57 suites.

1. Enable automatic CI (was workflow_dispatch-only)

Runs on push (development, master) and pull_request:

  • forge build (compile check)
  • forge test -vvv excluding the 7 fork-test files.

workflow_dispatch still runs the full suite (incl. fork tests) for on-demand runs with RPC env vars.

Fork tests excluded from auto-CI: 7 of 61 test files fork the chain and need live RPC/secrets; 2 fork unconditionally against hardcoded public RPCs (flaky). Excluding all 7 via --no-match-path keeps push/PR CI deterministic and secret-free (safe on fork PRs) — the euler-price-oracle model. Chosen over editing the tests to envOr+skip because on the repo's foundry vm.skip(true) in setUp fails the contract, so guarding would mean ~34 per-function edits changing local behavior; the glob achieves the same with zero test changes.

2. Workflow hardening

  • permissions: contents: read
  • actions/checkout@v4 → SHA-pinned v4.2.2 + persist-credentials: false
  • foundry-toolchain@v1 → SHA-pinned v1.4.0 (both SHAs verified against tags)
  • version: nightly left floating (no fmt --check job, so pin-drift can't break it)

Latent issues this new CI surfaced (and how they're handled)

  1. FOUNDRY_PROFILE: ci referenced a non-existent profile. Recent foundry treats this as fatal (older versions only warned), so the build failed instantly. Removed the env var → default profile (correct solc/evm_version/fs_permissions).
  2. Case-sensitivity bug (fixed here): HookTargetMarketStatus.sol imported ../Chainlink/DatastreamsVerifier.sol (lowercase 's') but the file is DataStreamsVerifier.sol. Compiles on macOS, fails on Linux — the repo did not build on any case-sensitive filesystem. One-char fix.
  3. Oversized contract (NOT fixed — needs your call): forge build --sizes fails because ERC4626EVCCollateralSecuritizeFactory is 25,588 bytes runtime, over the EIP-170 limit (24,576) by ~1,012 under default optimizer settings — i.e. currently undeployable to mainnet. To avoid making CI red on a pre-existing issue, the build step uses plain forge build. Re-add --sizes once that contract is brought under the limit (via_ir / optimizer_runs / splitting).

Separately, repo-level secret scanning + push protection were enabled (settings, not in this diff).

Commits are unsigned (automated session; GPG pinentry unavailable) — amend with -S if required.

- add top-level permissions: contents: read (least-privilege token)
- SHA-pin actions/checkout to v4.2.2 with persist-credentials: false
- SHA-pin foundry-toolchain to v1.4.0

Both SHAs verified against their release tags.
The workflow previously ran only on workflow_dispatch, so nothing was
checked automatically on PRs (unlike EVK/EVC/EPO). Enable push +
pull_request triggers running forge build and the non-fork test suite.

Fork tests (7 files needing live RPC/secrets) are excluded from
automatic runs via --no-match-path to keep CI deterministic and safe on
fork PRs; workflow_dispatch still runs the full suite so they can be
exercised on demand with RPC env vars provided.
@kasperpawlowski kasperpawlowski changed the title chore: harden CI workflow token and pin actions chore: harden CI and run build + non-fork tests on push/PR Sep 1, 2026
The workflow set FOUNDRY_PROFILE=ci but foundry.toml defines no
[profile.ci]. Recent foundry treats a missing selected profile as a
fatal error (older versions only warned and fell back), so the build
failed immediately once the workflow started running on PRs. Use the
default profile, which carries the correct solc/evm_version/fs_permissions.
HookTargetMarketStatus.sol imported ../Chainlink/DatastreamsVerifier.sol
(lowercase 's') but the file is DataStreamsVerifier.sol. This compiles on
case-insensitive filesystems (macOS) but fails on Linux — surfaced now
that CI builds on ubuntu-latest.
forge build --sizes exits non-zero because ERC4626EVCCollateralSecuritizeFactory
(25,588 bytes) exceeds the EIP-170 runtime limit (24,576) under the repo's
default optimizer settings. That's a pre-existing deployability concern, not a
CI regression; enforcing it here would make CI red from day one. Use plain
forge build as a compile check (matching euler-vault-kit). Size enforcement can
be re-added once the oversized contract is addressed.
@kasperpawlowski
kasperpawlowski merged commit 816c594 into development Sep 1, 2026
1 check passed
@kasperpawlowski
kasperpawlowski deleted the chore/ci-hardening branch September 1, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant