Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/actions/clone-praxis/action.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions .github/actions/patch-praxis/action.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ on:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, labeled]
workflow_dispatch:
inputs:
debug:
description: "Enable verbose test output (V=1)"
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 }}
Expand All @@ -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

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, labeled]
merge_group:
branches: [main]
workflow_dispatch:
Expand All @@ -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 }}
Expand All @@ -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:
Expand Down Expand Up @@ -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

Expand Down
36 changes: 35 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
# -------------------------------------------------------------------
Expand Down Expand Up @@ -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"
Loading