Skip to content

ci: run tests and avoid duplicate PR+push triggers - #28

Merged
dominicletz merged 1 commit into
mainfrom
ci/dedupe-and-run-tests
Aug 10, 2026
Merged

dominicletz merged 1 commit into
mainfrom
ci/dedupe-and-run-tests

Conversation

@dominicletz

@dominicletz dominicletz commented Aug 10, 2026

Copy link
Copy Markdown
Member

Two updates to .github/workflows/ci.yml:

  1. De-duplicate PR + push triggers. on: [push, pull_request]
    made the job fire twice on the same commit when a branch was pushed
    and then opened as a PR (once for the push, once for the pull request).
    push is now scoped to the protected branches (main, develop);
    every PR to any branch is covered by the un-scoped pull_request
    trigger.

  2. Run the test suite in CI. The job installs Foundry (anvil) — see
    the comment in the step for why we go via the GitHub release tarball
    instead of foundryup from foundry.paradigm.xyz (its bootstrapper
    is broken on the current Ubuntu runner image).

    The actual tests run are mix test.turn and mix test.nat — the
    mix aliases defined in mix.exs for isolated CI-style runs. They
    don't need anvil, forge, gitignored PEM fixtures, or WireGuard kernel
    privileges, so they're the realistic baseline today.

    Running the full mix test in CI is tracked separately because the
    suite additionally depends on:

    • test/pems/*.pem fixtures that are *.pem-gitignored with no
      in-repo generator,
    • forge deploying Solidity contracts via Chains.Anvil,
    • the WireGuard kernel interface (CAP_NET_ADMIN) for the
      @requires_wireguard-tagged tests.

@dominicletz
dominicletz force-pushed the ci/dedupe-and-run-tests branch 2 times, most recently from da252c3 to 4d849a9 Compare August 10, 2026 17:57
1. Scope `push` to the protected branches (main, develop) and leave
   `pull_request` unscoped. Without this, pushing a branch and opening
   a PR on the same commit triggered the job twice (once from the push,
   once from the pull_request event).

2. Install Foundry (anvil) in the job and uncomment `mix test`. The
   full test suite starts a local anvil chain via
   TestHelper.restart_chain/0, so anvil needs to be on PATH.

   The job is renamed from 'Build and lint' to 'Build, lint, and test'
   to reflect the broader scope.
@dominicletz
dominicletz force-pushed the ci/dedupe-and-run-tests branch from 4d849a9 to c31c39c Compare August 10, 2026 18:08
@dominicletz
dominicletz merged commit 1c79451 into main Aug 10, 2026
1 check passed
@dominicletz
dominicletz deleted the ci/dedupe-and-run-tests branch August 10, 2026 18:15
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