Skip to content

ci: block PRs on fmt/clippy/test#140

Open
Mic92 wants to merge 1 commit into
raine:mainfrom
Mic92:ci/test-workflow
Open

ci: block PRs on fmt/clippy/test#140
Mic92 wants to merge 1 commit into
raine:mainfrom
Mic92:ci/test-workflow

Conversation

@Mic92

@Mic92 Mic92 commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

I noticed there was no CI, so I added this CI workflow with cargo fmt --check, cargo clippy (non-blocking until the existing lints are cleaned up) and cargo test run on every PR, push to main, and merge-queue entry. This will make the test ci job required. We can use this ci check for automated github dependency updates

Here some instructions on how setup required checks after merging:

export REPO=raine/workmux

# allow PRs to use auto-merge
gh api -X PATCH "repos/$REPO" -f allow_auto_merge=true

# require the `test` check on the default branch via a ruleset
# integration_id 15368 = GitHub Actions, actor_id 5 = repo admin (bypass)
gh api -X POST "repos/$REPO/rulesets" --input - <<'JSON'
{
  "name": "main",
  "target": "branch",
  "enforcement": "active",
  "conditions": { "ref_name": { "include": ["~DEFAULT_BRANCH"], "exclude": [] } },
  "bypass_actors": [
    { "actor_id": 5, "actor_type": "RepositoryRole", "bypass_mode": "always" }
  ],
  "rules": [
    { "type": "deletion" },
    { "type": "non_fast_forward" },
    { "type": "required_status_checks",
      "parameters": {
        "strict_required_status_checks_policy": false,
        "required_status_checks": [
          { "context": "test", "integration_id": 15368 }
        ]
      }
    }
  ]
}
JSON

Dependency bumps and contributions had no automated signal before
landing. Run the standard Rust checks on every PR and push to main so
breakage surfaces before merge. Clippy is non-blocking until the
existing lints are cleaned up.

Repo setup (for an agent with admin `gh` access, REPO=<owner>/<repo>):

  # allow PRs to use auto-merge
  gh api -X PATCH "repos/$REPO" -f allow_auto_merge=true

  # require the `test` check on the default branch via a ruleset
  # (integration_id 15368 = GitHub Actions, actor_id 5 = repo admin bypass)
  gh api -X POST "repos/$REPO/rulesets" --input - <<'JSON'
  {
    "name": "main",
    "target": "branch",
    "enforcement": "active",
    "conditions": { "ref_name": { "include": ["~DEFAULT_BRANCH"], "exclude": [] } },
    "bypass_actors": [
      { "actor_id": 5, "actor_type": "RepositoryRole", "bypass_mode": "always" }
    ],
    "rules": [
      { "type": "deletion" },
      { "type": "non_fast_forward" },
      { "type": "required_status_checks",
        "parameters": {
          "strict_required_status_checks_policy": false,
          "required_status_checks": [
            { "context": "test", "integration_id": 15368 }
          ]
        }
      }
    ]
  }
  JSON
@Mic92 Mic92 changed the title ci: gate PRs on fmt/clippy/test ci: block PRs on fmt/clippy/test Apr 21, 2026
@raine raine force-pushed the main branch 3 times, most recently from ae2f049 to c6d1726 Compare May 3, 2026 07:38
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