From d24a6b527cb0b40949977418feeae6fa783a2dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 9 Jul 2026 21:46:30 +0200 Subject: [PATCH] ci: add optional praxis main testing and known-issue label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add CI support for testing against praxis core main branch via workflow_dispatch input, and a praxis-known-issue PR label that allows jobs to pass despite failures from transient core issues. Signed-off-by: Sébastien Han --- .github/actions/clone-praxis/action.yml | 20 ++++++++++++++ .github/actions/patch-praxis/action.yml | 20 ++++++++++++++ .github/workflows/integration.yaml | 15 +++++++++++ .github/workflows/tests.yaml | 24 +++++++++++++++++ Makefile | 36 ++++++++++++++++++++++++- 5 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 .github/actions/clone-praxis/action.yml create mode 100644 .github/actions/patch-praxis/action.yml diff --git a/.github/actions/clone-praxis/action.yml b/.github/actions/clone-praxis/action.yml new file mode 100644 index 00000000..12f7f3a1 --- /dev/null +++ b/.github/actions/clone-praxis/action.yml @@ -0,0 +1,20 @@ +name: Clone Praxis core +description: >- + Clone praxis core repo as a sibling directory so + path-based [patch.crates-io] overrides resolve. + +inputs: + ref: + description: "Git ref to checkout (branch, tag, or SHA)" + required: false + default: "main" + +runs: + using: composite + steps: + - name: Clone praxis core + run: >- + git clone --depth 1 --branch "${{ inputs.ref }}" + https://github.com/praxis-proxy/praxis.git + "$GITHUB_WORKSPACE/../praxis" + shell: bash diff --git a/.github/actions/patch-praxis/action.yml b/.github/actions/patch-praxis/action.yml new file mode 100644 index 00000000..63982a18 --- /dev/null +++ b/.github/actions/patch-praxis/action.yml @@ -0,0 +1,20 @@ +name: Patch Praxis dependencies +description: >- + Override crates.io praxis dependencies with local + path dependencies from the cloned praxis repo. + +runs: + using: composite + steps: + - name: Append [patch.crates-io] to Cargo.toml + run: | + cat >> Cargo.toml << 'PATCH' + + [patch.crates-io] + praxis-proxy-core = { path = "../praxis/core" } + praxis-proxy-filter = { path = "../praxis/filter" } + praxis-proxy-protocol = { path = "../praxis/protocol" } + praxis-proxy-tls = { path = "../praxis/tls" } + praxis-proxy = { path = "../praxis/server" } + PATCH + shell: bash diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index b5881fc1..3a1db336 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -9,6 +9,7 @@ on: branches: [main] pull_request: branches: [main] + types: [opened, synchronize, reopened, labeled] workflow_dispatch: inputs: debug: @@ -16,6 +17,11 @@ on: required: false type: boolean default: false + praxis_main: + description: "Test against praxis core main branch instead of crates.io release" + required: false + type: boolean + default: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -34,11 +40,20 @@ jobs: test: runs-on: ubuntu-24.04 + continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'praxis-known-issue') }} permissions: contents: read steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - name: Clone Praxis core (path dependency) + if: inputs.praxis_main + uses: ./.github/actions/clone-praxis + + - name: Patch Praxis dependencies + if: inputs.praxis_main + uses: ./.github/actions/patch-praxis + - name: Install stable Rust uses: dtolnay/rust-toolchain@6190aa5fb88a88ee71c12769924bbe63a9ab152e # 1.96.0 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f00c65f5..60738c03 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,6 +9,7 @@ on: branches: [main] pull_request: branches: [main] + types: [opened, synchronize, reopened, labeled] merge_group: branches: [main] workflow_dispatch: @@ -18,6 +19,11 @@ on: required: false type: boolean default: false + praxis_main: + description: "Test against praxis core main branch instead of crates.io release" + required: false + type: boolean + default: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -36,11 +42,20 @@ jobs: lint: runs-on: ubuntu-24.04 + continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'praxis-known-issue') }} permissions: contents: read steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - name: Clone Praxis core (path dependency) + if: inputs.praxis_main + uses: ./.github/actions/clone-praxis + + - name: Patch Praxis dependencies + if: inputs.praxis_main + uses: ./.github/actions/patch-praxis + - name: Install nightly Rust (for rustfmt) uses: ./.github/actions/install-nightly-rust with: @@ -76,11 +91,20 @@ jobs: test: runs-on: ubuntu-24.04 + continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'praxis-known-issue') }} permissions: contents: read steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - name: Clone Praxis core (path dependency) + if: inputs.praxis_main + uses: ./.github/actions/clone-praxis + + - name: Patch Praxis dependencies + if: inputs.praxis_main + uses: ./.github/actions/patch-praxis + - name: Install stable Rust uses: dtolnay/rust-toolchain@6190aa5fb88a88ee71c12769924bbe63a9ab152e # 1.96.0 diff --git a/Makefile b/Makefile index df46addc..08348cbf 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,8 @@ endif lint fmt doc audit coverage-check \ require-container-engine \ container container-run \ - setup-hooks help + setup-hooks help \ + patch-praxis unpatch-praxis # ------------------------------------------------------------------- # All @@ -105,6 +106,35 @@ coverage-check: exit 1; \ fi +# ------------------------------------------------------------------- +# Praxis path override (test against local ../praxis) +# ------------------------------------------------------------------- + +patch-praxis: + @if [ ! -d "../praxis" ]; then \ + echo "ERROR: ../praxis not found — clone praxis core as a sibling directory first"; \ + exit 1; \ + fi + @if grep -q '\[patch\.crates-io\]' Cargo.toml; then \ + echo "Already patched — run 'make unpatch-praxis' first"; \ + exit 1; \ + fi + @printf '\n[patch.crates-io]\n\ + praxis-proxy-core = { path = "../praxis/core" }\n\ + praxis-proxy-filter = { path = "../praxis/filter" }\n\ + praxis-proxy-protocol = { path = "../praxis/protocol" }\n\ + praxis-proxy-tls = { path = "../praxis/tls" }\n\ + praxis-proxy = { path = "../praxis/server" }\n' >> Cargo.toml + @echo "Patched Cargo.toml to use ../praxis path dependencies" + +unpatch-praxis: + @if ! grep -q '\[patch\.crates-io\]' Cargo.toml; then \ + echo "Nothing to unpatch"; \ + exit 0; \ + fi + @sed -i.bak '/^\[patch\.crates-io\]/,$$d' Cargo.toml && rm -f Cargo.toml.bak + @echo "Removed [patch.crates-io] from Cargo.toml" + # ------------------------------------------------------------------- # Dev Setup # ------------------------------------------------------------------- @@ -145,3 +175,7 @@ help: @echo "Container:" @echo " container build praxis-ai container image" @echo " container-run run container in foreground (host network)" + @echo "" + @echo "Praxis override:" + @echo " patch-praxis use ../praxis path deps instead of crates.io" + @echo " unpatch-praxis revert to crates.io praxis deps"