diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ce43675a..541406001 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: pull_request: + types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed] push: branches: [main] @@ -14,6 +15,7 @@ concurrency: jobs: rust: + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} name: Rust contracts runs-on: ubuntu-24.04 steps: @@ -62,6 +64,7 @@ jobs: run: cargo doc --locked --workspace --no-deps coverage: + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} name: Production coverage runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/mv3-compatibility.yml b/.github/workflows/mv3-compatibility.yml index 2b2e1ac64..a9de2a1da 100644 --- a/.github/workflows/mv3-compatibility.yml +++ b/.github/workflows/mv3-compatibility.yml @@ -3,6 +3,7 @@ name: Manifest V3 Compatibility on: workflow_dispatch: pull_request: + types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed] paths: - ".github/workflows/mv3-compatibility.yml" - "crates/originweave-core/**" @@ -20,6 +21,7 @@ concurrency: jobs: chrome-for-testing: + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} name: Pinned Chrome for Testing MV3 fixture runs-on: ubuntu-24.04 timeout-minutes: 20 diff --git a/tests/test_mv3_compatibility_contract.py b/tests/test_mv3_compatibility_contract.py index b8637bf0f..48c497e68 100644 --- a/tests/test_mv3_compatibility_contract.py +++ b/tests/test_mv3_compatibility_contract.py @@ -181,6 +181,11 @@ def test_workflow_runs_the_real_browser_lane_without_model_credentials(self) -> self.assertIn("${{ github.workflow }}-${{ github.repository }}", workflow) self.assertIn("${{ github.event.pull_request.number || github.run_id }}", workflow) self.assertIn("cancel-in-progress: ${{ github.event_name == 'pull_request' }}", workflow) + self.assertIn( + "types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed]", + workflow, + ) + self.assertIn("github.event.pull_request.draft == false", workflow) def test_doctoring_records_primary_chromium_evidence(self) -> None: """The exact browser baseline and non-compatibility claims must be documented.""" diff --git a/tests/test_repository_contract.py b/tests/test_repository_contract.py index 0ea3d1700..00ceb5a12 100644 --- a/tests/test_repository_contract.py +++ b/tests/test_repository_contract.py @@ -123,6 +123,11 @@ def test_ci_validates_the_exact_pull_request_head(self) -> None: self.assertIn("${{ github.workflow }}-${{ github.repository }}", workflow) self.assertIn("${{ github.event.pull_request.number || github.run_id }}", workflow) self.assertIn("cancel-in-progress: ${{ github.event_name == 'pull_request' }}", workflow) + self.assertIn( + "types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed]", + workflow, + ) + self.assertEqual(workflow.count("github.event.pull_request.draft == false"), 2) self.assertNotIn("cargo check --locked --workspace --all-targets", workflow) def test_hourly_loop_uses_nvidia_nim_and_dedicated_publication_authority(self) -> None: